adjust-icon

Braze SDK integration

Use the Braze SDK integration to pass Braze identifiers to the Adjust Flutter SDK. Adjust can then include those identifiers in callbacks sent to Braze.

Before You Begin

Before you configure the Braze SDK integration, complete the following tasks:

  1. Integrate the Adjust Flutter SDK.
  2. Integrate the Braze Flutter SDK.
  3. Set up Braze in your Adjust dashboard and configure which callbacks to send.

Pass The Braze Device ID

Pass braze_device_id after you initialize the Braze SDK and before you initialize the Adjust SDK. Braze uses this value to identify the device in install callbacks.

BrazePlugin braze = BrazePlugin();
String brazeDeviceId = await braze.getDeviceId();
Adjust.addGlobalPartnerParameter('braze_device_id', brazeDeviceId);
AdjustConfig adjustConfig =
AdjustConfig('{YourAppToken}', AdjustEnvironment.sandbox);
Adjust.initSdk(adjustConfig);

Pass The Braze External ID

Pass external_id when the user logs in or when the app assigns a user identifier. This value must match the user ID passed to the Braze changeUser() method. Braze requires external_id to process post-install events such as custom events and purchases.

braze.changeUser('USER_ID');
Adjust.addGlobalPartnerParameter('external_id', 'USER_ID');

If the user logs out, remove the global partner parameter.

Adjust.removeGlobalPartnerParameter('external_id');

Pass The Product ID For Purchases

Pass product_id on each purchase event that you send to Adjust. Braze requires product_id to process purchase events as revenue events. Without it, Adjust forwards the event as a regular post-install event instead.

AdjustEvent purchaseEvent = AdjustEvent('EVENT_TOKEN');
purchaseEvent.setRevenue(1.99, 'USD');
purchaseEvent.addPartnerParameter('product_id', 'PRODUCT_ID');
Adjust.trackEvent(purchaseEvent);