Skip to content

Commit ee10155

Browse files
authored
Update documentation and version numbers for release (#54)
1 parent 42c3b17 commit ee10155

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.5.0 - January 26, 2024
4+
5+
- **Breaking Changes** A new `onWebPixelEvent(PixelEvent)` function has been added to the `CheckoutEventProcessor` interface. This allows listening for [Web Pixel](https://shopify.dev/docs/apps/marketing/pixels) events that take place in checkout, so they can be emitted to your preferred analytics system. See `README.md` for more details.
6+
7+
_Note_: If your processor extends `DefaultCheckoutEventProcessor`, a no-op implementation has been added, so no changes are required unless you'd like to respond to pixel events. If your processor does not extend `DefaultCheckoutEventProcessor`, you will need to implement this function.
8+
9+
- Fix: Prevent loading checkout twice during preloads.
10+
- Fix: Match `CheckoutDialog`'s header padding with checkout's padding.
11+
- Fix: Ensure the WebView cache is cleared on error responses for preloaded requests.
12+
313
## 0.4.0 - January 10, 2024
414

515
- **Breaking Changes:** The library has been rebranded from Shopify Checkout Kit to Shopify Checkout Sheet Kit. Apologies for any inconvenience caused. Here are the steps to upgrade:

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ val processor = object : WebEventProcessor {
252252
// - web (http:)
253253
// and is being directed outside the application.
254254
}
255+
256+
override fun onWebPixelEvent(event: PixelEvent) {
257+
// Called when a web pixel event is emitted in checkout.
258+
// Use this to submit events to your analytics system, see below.
259+
}
255260
}
256261
257262
```
@@ -261,6 +266,42 @@ val processor = object : WebEventProcessor {
261266
App developers can use [lifecycle events](#monitoring-the-lifecycle-of-a-checkout-session) to
262267
monitor and log the status of a checkout session.
263268
269+
To safeguard user privacy, [Web Pixel](https://shopify.dev/docs/apps/marketing/pixels) events will not be dispatched from within the checkout webview. Instead, the events will be relayed back to your application through the `onWebPixelEvent` checkout event processor function.
270+
271+
Implement this function to process the events you're interested in, augment them with customer and session identity, transform them into an appropriate schema and submit them to your preferred analytics system. For example:
272+
273+
```kotlin
274+
fun onWebPixelEvent(event: PixelEvent) {
275+
if (!hasPermissionToCaptureEvents()) {
276+
return
277+
}
278+
279+
when (event) {
280+
is StandardPixelEvent -> processStandardEvent(event)
281+
is CustomPixelEvent -> processCustomEvent(event)
282+
}
283+
}
284+
285+
fun processStandardEvent(event: StandardPixelEvent) {
286+
const endpoint = "https://example.com/pixel?id=${accountID}&uid=${userId}";
287+
288+
val payload = AnalyticsPayload(
289+
eventTime: event.timestamp,
290+
action: event.name,
291+
details: event.data.checkout
292+
)
293+
294+
// Send events to third-party servers
295+
httpClient.post(endpoint, payload)
296+
}
297+
298+
// ... other functions, incl. processCustomEvent(event)
299+
```
300+
301+
_Note: You will likely need to augment these events with customer/session information derived from app state._
302+
303+
_Note: The `customData` attribute of CustomPixelEvent can take on any shape. As such, this attribute will be returned as a String. Client applications should define a custom data type and deserialize the `customData` string into that type._
304+
264305
### Integrating identity & customer accounts
265306

266307
Buyer-aware checkout experience reduces friction and increases conversion. Depending on the context

lib/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def resolveEnvVarValue(name, defaultValue) {
1414
return rawValue ? rawValue : defaultValue
1515
}
1616

17-
def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "0.4.1")
17+
def versionName = resolveEnvVarValue("CHECKOUT_SHEET_KIT_VERSION", "0.5.0")
1818

1919
ext {
2020
app_compat_version = '1.6.1'

samples/MobileBuyIntegration/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ android {
2828
applicationId "com.shopify.checkout_sdk_mobile_buy_integration_sample"
2929
minSdk 23
3030
targetSdk 34
31-
versionCode 20
31+
versionCode 21
3232
versionName "0.0.${versionCode}"
3333

3434
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

0 commit comments

Comments
 (0)