Skip to main content

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.

important

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

mParticle requirements

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.

note

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:

  1. In mParticle, open Setup > Inputs and switch to the Feeds page.
  2. If there's a Custom Feed section with existing feeds, open it and click +. Otherwise, click Add Feed Input and select Custom Feed.
  3. 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.
  4. Click Save.
  5. 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:

  1. In mParticle, open Setup > Outputs and switch to the Audience page.
  2. If there's a Talon.One Default section with existing outputs, open it and click +. Otherwise, click Add Audience Output and select Talon.One.
  3. 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.
  4. 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:

  1. 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.
  2. Click Create.
  3. On the Build page, click Add Criteria.
  4. Click Sessions, select the feed input, and click Done.
  5. In Recency / Frequency, enter Greater Than 0 Sessions Within the last 1 Days and click Done.
  6. On the Connect page, click Connect Output.
  7. In the Connect Output window, under Configuration Name, select the audience output you created.
  8. 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:

  1. Use curl or a similar tool to send the following request, where:

    • FEED_INPUT_KEY and FEED_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"
    }
    ]
    }'
    note

    This request is for testing purposes only. You should customize it for your actual setup.

  2. In mParticle, open Data Master > Live Stream and check whether mParticle has received the request.

  3. In Talon.One:

    1. Click Audiences, open the audience created by mParticle, and check whether a customer with the given customer ID has been added to the audience.

      note

      Adding members to the audience may take a few minutes.

    2. Open your campaign, click Coupons, and check whether a coupon has been generated for the given customer ID.