Skip to main content

Using event data with mParticle

mParticle allows you to capture event data and use an event output to send the data to Talon.One in close to real time.

For example, if customers click a button on your website, you can collect the event data using mParticle, and forward it to Talon.One.

Then, in Talon.One, you can create coupon codes to offer everyone who clicked the button 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 send the click event data from your website to mParticle.

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 event output

With an event output, you can send data from mParticle to Talon.One. In this tutorial, we'll use an event output to forward the click event data.

To create the event output:

  1. In mParticle, open Setup > Outputs.
  2. If there's a Talon.One Default Group section with existing outputs, open it and click +. Otherwise, click Add Event Output and select Talon.One.
  3. In the Output: Event Configuration window, configure the following parameters:
    • Configuration Name: Type a configuration name.
    • Use same settings for Development & Production: Select this option.
    • 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 the user identity to map with Talon.One as the customer's user ID. In this tutorial, we'll use Customer ID.
    • Run Rule Engine: Select this option.
  4. Click Save.

Creating the connection

Now that we have created an input and an output, let's connect them, so that the click event data flows from your website via mParticle to Talon.One.

To create the connection:

  1. In mParticle, open Connections > Connect.
  2. Click the custom feed input you created.
  3. Click Connect Output.
  4. In the Connect Output window, select the event output you created.
  5. Set Connection Status to Active.
  6. Click Add Connection.

Enabling data forwarding

After creating the connection, mParticle's Data Filter feature may prevent data from being forwarded.

To enable data forwarding:

  1. In mParticle, open Connections > Feed Filters.
  2. At the top of the page, select the feed input you created.
  3. Select the Send new data points by default checkbox.
  4. Enable all data points:
    1. On the Events page, in the Events Data Type Filter section, click ... > Turn ON all data points.
    2. On the Users page, in the Users Data Type Filter section, click ... > Turn ON all data points.
  5. Click Save.
info

It takes a few minutes for the changes to take effect.

Building the rule in Talon.One

To act on events sent via mParticle, create a rule in your Talon.One campaign with the following logic:

WhatNameProperties
ConditionsCheck for event types
and custom event values
  • Event type: mparticle_event
    If the event type does not exist, see Troubleshooting.
  • mparticle_event (Event) is equal to YOUR_EVENT_NAME,
    where YOUR_EVENT_NAME is equal to the value of event_name in your requests.
    In this tutorial, we use click_event.
EffectsCreate coupon codeSet your desired coupon settings.

When Talon.One receives an event with the given name, 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_name": "click_event",
    "custom_event_type": "other"
    },
    "event_type": "custom_event"
    }
    ]
    }'
    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 Live Stream, set Message Direction to Outbound and check whether mParticle has forwarded the request.

  4. In Talon.One:

    1. Open your Application, click Events, and check whether an mparticle_event event has been received.
    2. Open your campaign, click Coupons, and check whether a coupon has been generated for the given customer ID.

Troubleshooting

When you build a rule, if the mparticle_event event type does not yet exist, send the following test request to Talon.One, where:

  • YOUR_API_KEY is the API key you created.
  • YOUR_DEPLOYMENT_URL is the base URL of your Talon.One deployment.
curl --location 'https://integration.talon.one/mparticle' --header 'Content-Type: application/json' --data '{
"type": "event_processing_request",
"account": {
"account_settings": {
"apiKey": "YOUR_API_KEY",
"deploymentURL": "YOUR_DEPLOYMENT_URL",
"userIdField": "mpid"
}
},
"events": [
{
"type": "custom_event",
"name": "test_event"
}
],
"mpid": "12345"
}'