Batch

This section describes how to integrate Batch with Purchasely

Integrating Purchasely with Batch

🚧

Integration requirement

The integration of Purchasely and Batch requires the activation of the Trigger Events API on Batch side. Please contact directly your Batch account manager to activate the access to this feature.

The integration requires 5 steps:

  1. Activate the Batch integration in the Purchasely Console
  2. Enable the forwarding of Server Events in the Purchasely Console
  3. Enable the update of User Properties in the Purchasely Console
  4. Enable the events in the Batch Dashboard
  5. Set Batch SDK Custom User ID

1 - Activate the Batch integration in the Purchasely Console

In the Purchasely Console, go to "Integration » Batch" and enable the integration.

Then carry the Android / iOS Live / Rest API keys forward from your Batch Dashboard to the Purchasely Console.

These parameters can be found in your Batch Dashboard in the following location:
Batch Dashboard » You [iOS / Android] app » Settings » General » API Keys

Screenshot of the Batch Dashboard (January 2022)

Screenshot of the Batch Dashboard (January 2022)

2 - Enable the forwarding of Server Events in the Purchasely Console

In the Purchasely Console, under the tab Server Events, you can choose with Server Events must be forwarded to Batch.

(Optional) Events names can be overridden to match with your tacking plan.

📘

Keep in mind

UI / SDK Events triggered by the Purchasely SDK cannot be forwarded to Batch directly from the Purchasely Console.

This has to be done at the app level by intercepting the SDK events and forwarding them to the Batch SDK.

Each event sent to Braze carries a set of properties that you can use to further personalize your campaigns or automations.

3 - Enable the update of User Properties in the Purchasely Console

In the Purchasely Console, under the tab User Properties, you can choose with User Properties should be updated in real time along the subscription lifecycle.

(Optional) User Properties names can be overridden to match with your nomenclature.

Details on User Properties are accessible here.

4 - Enable the Events and Attribute in the Batch Dashboard

Once events have been enabled on Purchasely's side, they must also be enabled on Batch's side as well.

To do so, navigate to the following location:
Batch Dashboard » You [iOS / Android] app » Settings » Custom Data » Attributes / User events

Screenshot of the Batch Dashboard (January 2022)

Screenshot of the Batch Dashboard (January 2022)

📘

Keep in mind

Purchasely Events must have been received at least once on Batch's side to appear in this list of User events. Same with User Properties (Attributes)


4- Set Batch SDK Custom User ID (SDK implementation)

🚧

Mandatory step

This step is very important, otherwise events sent by Purchasely will not be properly associated with users

Configure Batch SDK with the same User ID that is given to Purchasely SDK through the dedicated method:

Purchasely.userLogin(with "john.doe");
Purchasely.userLogin(with "john.doe");
Purchasely.userLogin("john.doe");
Purchasely.userLogin('john.doe');
Purchasely.userLogin('john.doe');
private PurchaselyRuntime.Purchasely _purchasely;
...
_purchasely.UserLogin("john.doe", OnUserLoginCompleted);

Then set Batch SDK with:

Batch.User.editor()
    .setIdentifier("john.doe")
    .save();
...

For more details, see Batch documentation:

🚧

If Batch Custom user ID is actually different from Purchasely User ID

If your users in Batch are tracked using a different ID from Purchasely, you can tell our SDK and we will use this ID instead:

Purchasely.setAttribute(.batchCustomUserId, value: "theUserId")
Purchasely.setAttribute(Attribute.BATCH_CUSTOM_USER_ID, "YOUR_USER_ID")

Setting-up your first automation

To configure your automations navigate to the following location in Batch:

Batch » Campaigns

To create an automation triggered by a Purchasely event, choose Trigger in the block When.


All the events that have already been received at least once by Batch will appear in the list.

You can even add a filter (set of condition) on the event attributes.

You can then define the message that will be sent and the deeplink associated to it.


If the deeplink matches a pattern handled by Purchasely, it will allow you to:

  • display a specific Screen (for upsell and retention flow)
  • display a cancellation survey
  • notify users that their credit card has expired and send them to their devices settings

More information in the section deeplinks automations.

For more information about Batch Dashboard and campaigns configuration, please refer directly to Batch Documentation.


What’s Next