Running promotions for mParticle audiences
mParticle allows you to define audiences and connect them to Talon.One to engage with your customers.
For example, in mParticle, you can group all customers who recently visited your website into an audience, and forward the audience to Talon.One.
Then, in Talon.One, you can create coupon codes to offer members of the audience a discount for their next purchase.
In this tutorial, we assume you are using mParticle's original UI. To enable it, sign in to mParticle and click Settings > Go to Classic Experience.
Talon.One requirements
- You are an Admin user.
- You have set up an Application.
- Your Application contains a running campaign with the Coupons feature enabled.
- You have created an mParticle-specific API key.
mParticle requirements
- You are an Admin user.
Creating the feed input
Feed inputs allow you to send data to mParticle. In this tutorial, we'll use a custom feed input to add customers to our audience.
You can also use a Talon.One feed input for this. However, because we're not sending data from Talon.One, a custom feed is more appropriate.
To create the feed input:
- In mParticle, open Setup > Inputs and switch to the Feeds page.
- If there's a Custom Feed section with existing feeds, open it and click +. Otherwise, click Add Feed Input and select Custom Feed.
- In the Input: Feed Configuration window, configure the following parameters:
- Configuration Name: Type a configuration name.
- Feed Status: Select Active.
- Input Protection Level: Select Create & Update Profiles.
- Click Save.
- Save the Server to Server Key and Server to Server Secret values for later use. We'll need them for testing.
Creating the audience output
Audience outputs allow you to send audience membership data from mParticle to Talon.One. In this tutorial, we'll use an audience output to forward the customer ID of audience members to Talon.One.
To set up the audience output:
- In mParticle, open Setup > Outputs and switch to the Audience page.
- If there's a Talon.One Default section with existing outputs, open it and click +. Otherwise, click Add Audience Output and select Talon.One.
- In the Audience Configuration window, configure the following parameters:
- Configuration Name: Type a configuration name.
- API Key: Paste the API key you created.
- Deployment URL: Type the base URL of your Talon.One deployment, for example,
mycompany.europe-west1.talon.one
. - User ID: Select which attribute to forward to Talon.One as the user ID. For this tutorial, we'll use Customer ID.
- Run Rule Engine: Enable this setting.
- Click Save.
Creating the mParticle audience
Now that we have created an input and an output, let's create the audience. The audience should include all customers who recently visited your website. You can track this via mParticle's session events.
Customers with at least one active session within the last day should be added to the mParticle audience, and be forwarded to Talon.One.
To create the mParticle audience:
- In mParticle, open Audiences > Real-time and click New Audience.
- In Audience Name, type the name of the audience in mParticle.
- In External Name, type the name of the audience that the data should be forwarded to.
- In Audience Sources, select the feed input you created.
- Click Create.
- On the Build page, click Add Criteria.
- Click Sessions, select the feed input, and click Done.
- In Recency / Frequency, enter
Greater Than
0
Sessions
Within the last
1
Days
and click Done. - On the Connect page, click Connect Output.
- In the Connect Output window, under Configuration Name, select the audience output you created.
- Go back to the Build page and click Activate.
An audience with the external name is automatically created in Talon.One. Customers who join the mParticle audience will be forwarded to the Talon.One audience.
Building the rule in Talon.One
To reference the audience in your Talon.One campaign, create a rule with the following logic:
- Condition: Has joined an audience, with the audience created by mParticle selected.
- Effect: Create coupon code.
When a customer profile is added to the audience via the mParticle connection, the rule is triggered, and a coupon code is created.
Testing the connection
Let's test our setup using the Events API provided by mParticle.
To test the connection:
-
Use curl or a similar tool to send the following request, where:
FEED_INPUT_KEY
andFEED_INPUT_SECRET
are the key and secret values of the feed input you created.YOUR_CUSTOMER_ID
is a customer ID of your choice, for example,John Doe
.
curl --location 'https://s2s.mparticle.com/v2/events' --user 'FEED_INPUT_KEY:FEED_INPUT_SECRET' --header 'Content-Type: application/json' --data '{
"schema_version": 2,
"environment": "development",
"user_identities": {
"customer_id": "YOUR_CUSTOMER_ID"
},
"events": [
{
"data": {},
"event_type": "session_start"
}
]
}'noteThis request is for testing purposes only. You should customize it for your actual setup.
-
In mParticle, open Data Master > Live Stream and check whether mParticle has received the request.
-
In Talon.One:
-
Click Audiences, open the audience created by mParticle, and check whether a customer with the given customer ID has been added to the audience.
noteAdding members to the audience may take a few minutes.
-
Open your campaign, click Coupons, and check whether a coupon has been generated for the given customer ID.
-