Skip to content
Merged
55 changes: 55 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,61 @@
This document provides guidance on how to migrate from one version of the SDK to a newer version.
It will be updated as new versions are released including deprecations or breaking changes.

# 4.5.0

Comment thread
coderabbitai[bot] marked this conversation as resolved.
## New Automatic Push Behaviors (Manifest Flags)

SDK 4.5.0 introduces two push behaviors controlled via `AndroidManifest.xml` metadata:
`automatic_push_open_tracking` (new, opt-in) and `automatic_push_token_forwarding` (**on by
default**, formalizing the SDK's existing automatic token forwarding). No action is required to
preserve your current behavior. If you manage push tokens manually and want to disable automatic
forwarding, opt out as described below.

### `automatic_push_open_tracking` (opt-in, default **off**)

When enabled, the SDK automatically records push-open events without requiring you to call
`Klaviyo.handlePush` manually in your notification interaction handler.

To enable, add the following to the `<application>` element of your `AndroidManifest.xml`:

```xml
<meta-data
android:name="com.klaviyo.push.automatic_push_open_tracking"
android:value="true" />
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small thing, but I would put the instructions in the README, and point the migration guide to the README for how to opt in/out of the flag.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice suggestion! will make this change


This flag defaults to **off** in 4.5.0. It is expected to become the default (opt-out) in a future
major release.

### `automatic_push_token_forwarding` (default **on**)

When this flag is enabled (which is the **default**), the SDK automatically registers the device's
FCM push token with Klaviyo on your behalf — you no longer need to call `Klaviyo.setPushToken`
manually on app startup.
Comment thread
glenn-klaviyo marked this conversation as resolved.

To opt out of automatic token forwarding and retain manual control, add the following to the
`<application>` element of your `AndroidManifest.xml`:

```xml
<meta-data
android:name="com.klaviyo.push.automatic_push_token_forwarding"
android:value="false" />
```

### Rollout summary

| Behavior | This release (4.5.0) | Future major release |
|---|---|---|
| `automatic_push_token_forwarding` | Default on (opt-out via manifest) | Default on |
| `automatic_push_open_tracking` | Opt-in (default off) | Default on (opt-out) |

> **Anonymous profiles:** When `automatic_push_token_forwarding` is enabled (the Android default),
> the SDK registers the device's push token with Klaviyo automatically — at initialization, when the
> app returns to the foreground, and whenever FCM issues a new token — which can occur before you call
> `setProfile`, `setEmail`, or `setPhoneNumber`. This results in an anonymous profile being created in Klaviyo
> until you provide identifying information. This is expected behavior. See
> [Anonymous Tracking](./README.md#anonymous-tracking) in the README.

# 4.3.0

## New Modules for Cross-Platform Support
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,14 @@ Klaviyo will track unidentified users with an autogenerated ID whenever a push t
That way, you can collect push tokens and track events prior to collecting profile identifiers such as email or
phone number. When an identifier is provided, Klaviyo will merge the anonymous user with an identified user.

> **Automatic push token forwarding:** When `automatic_push_token_forwarding` is enabled (the
> default in SDK 4.5.0+), the SDK registers the device's push token with Klaviyo automatically — at
> initialization, when the app returns to the foreground, and whenever FCM issues a new token — which
> can occur before any call to `setProfile`, `setEmail`, or `setPhoneNumber`. This results
> in an anonymous profile being created in Klaviyo until you provide identifying information.
> This is expected behavior. To opt out, see the
> [Migration Guide](./MIGRATION_GUIDE.md#automatic_push_token_forwarding-default-on).

## Event Tracking
The SDK provides tools for tracking analytics events via the
[Create Client Event API](https://developers.klaviyo.com/en/reference/create_client_event).
Expand Down
Loading