As you send campaigns, it's critical to gauge whether they're driving your intended business outcomes. Opens and clicks are an obvious place to start, but conversions can provide even more value.
When you send a campaign and a user takes a desired action — views a product, makes a purchase, shares something, fills in a form, takes a survey, or some other action that's important to you — you can track this conversion in Iterable as a custom event or a purchase. For purchases, you can also track revenue.
In many cases, it's valuable to track more than one conversion event for a single campaign. For example, you may want to know how many purchases resulted from a campaign, and also how many times users clicked a discount offer in that same campaign.
Using Campaign Analytics and Messaging Insights, you can analyze conversion, purchase, and revenue data, and determine whether your messaging is helping you achieve your goals.
This article describes how to:
- Choose the custom events that should count as conversions for a given campaign.
- Use Iterable's API to track conversion events and purchases.
- View conversion metrics in Iterable.
In this article
- Step 1: Configure your project to show revenue
- Step 2: Select conversion events
- Step 3: Choose attribution by campaignId, or by time
- Step 3: Send your campaign
- Step 4: Track custom events and purchases
- Step 5: View conversion, purchase, and revenue metrics
- Appendix: Finding attribution info
- Next steps
Step 1: Configure your project to show revenue
To see revenue-related metrics in Campaign Analytics and Messaging Insights, first enable the Show Revenue setting in Settings > Project Settings:
To enable this setting, work with your Iterable project administrator.
When this setting is disabled, revenue-related metrics aren't visible in Campaign Analytics or Messaging Insights, even if you track that data.
Step 2: Select conversion events
To choose conversion events for a campaign, select them in the Conversion Events dropdown, in the Conversion and Experiments area.
TIP
Make sure your project is configured to track the custom events you'll use as conversions. For more info, read Managing Custom Events.
You can also track purchases as conversions:
If you choose
iterable_purchase
as a conversion event, purchase events will count as conversions. In this case, purchase events affect your conversion metrics.If you do not choose
iterable_purchase
, purchase events will not count as conversions. You can still track purchases and associate them with your campaign, but they won't affect your conversion metrics. Purchase events will affect your purchase and revenue metrics, though.
IMPORTANT
To create purchase events:
- Call
POST /api/commerce/trackPurchase
. -
Do not use
POST /api/events/track
(or other event tracking endpoints) to create custom events namediterable_purchase
orpurchase
. If you do, Iterable won't treat them as purchase events – they'll just be standard custom events.
campaignId
, or by time
Step 3: Choose attribution by Next, decide how you'll attribute custom events and purchases to your campaign.
You can attribute by campaignId
or by time-based attribution.
campaignId
Option 1: Attribution by If you choose to manually specify attribution information, you'll need to include
userId
or email
, campaignId
, and templateId
when you call Iterable's
event or purchase tracking APIs.
NOTE
Attributing custom events and purchases to a specific templateId
is useful when
running A/B tests, where each experiment variation has a different templateId
.
-
For event tracking:
-
For purchase tracking:
When you're not using time-based attribution, there are two ways to find the
right campaignId
and templateId
to include in event and purchase tracking API
calls:
- Link parameters
- Browser cookies (only email campaigns from email-based projects can use this option)
Before sending your campaign, decide which of these methods you'll use, and make sure you're properly set up to do so (as described in the above links).
Option 2: Time-based attribution
With time-based attribution, you'll still call Iterable's API to track custom events and purchases. However, during the specified attribution period, Iterable automatically attributes new events and/or purchases to your campaign, as long as they're of the types you've indicated should count as conversions for that campaign.
To identify a user, event and purchase tracking API requests must include an
email
or userId
. However, with time-based attribution, Iterable performs
campaign attribution automatically, so you can omit campaignId
and
templateId
from your request.
Time-based attribution can be less accurate than campaignId
attribution, since
it's based on the assumption that all conversions and purchases within the
specified attribution period result from your campaign.
Some things to remember about time-based attribution:
If you send multiple campaigns to a single user, and each campaign has a different time-based attribution period for the same conversion event or purchase, Iterable attributes that user's conversions and purchases to the most recently sent campaign with an active attribution period.
If you include a
campaignId
ortemplateId
when calling Iterable's API to track an event or purchase, those values override thecampaignId
andtemplateId
that would be set by any open time-based attribution period.If the user specified in an event or purchase-tracking API call was not sent the campaign in question, Iterable doesn't attribute that event or purchase to the campaign.
Step 3: Send your campaign
Finish configuring your campaign and send it so you can start tracking custom events and purchases.
Step 4: Track custom events and purchases
As users convert on a campaign, taking actions and making purchases, call Iterable's API to track custom events and purchases. To learn how to find the values to include in these requests, read Appendix: Finding Attribution Info.
Viewing a user's events and purchases
To view custom events and purchases you've tracked in Iterable:
- Navigate to Audience > Contact Lookup, pulling up a user profile, and look in the Events area.
- Call
GET /api/events/{email}
orGET /api/events/byUserId/{userId}
.
Event tracking API
Here's a sample API request to track an event:
{ "email": "user@example.com", "eventName": "completedSurvey", "campaignId": 1234567, "templateId": 9876543 }
You can also track events in bulk: POST /api/events/trackBulk
.
Purchase tracking API
Here's a sample API request to track a purchase:
POST /api/commerce/trackPurchase
{ "id": "string", "user": { "email": "user@example.com", }, "items": [ { "id": "yoyo1", "sku": "12345", "name": "Yo-Yo", "description": "A red yo-yo.", "categories": [ "toy" ], "price": 6.99, "quantity": 1, "imageUrl": "https://example.com/products/yoyo1/image.png", "url": "https://example.com/products/yoyo1", } ], "campaignId": 1234567, "templateId": 9876543, "total": 6.99 }
You can track multiple purchases for the same user, for the same campaign.
IMPORTANT
Do not use POST /api/events/track
(or other event tracking endpoints) to create custom events named iterable_purchase
or purchase
. If you do, Iterable won't treat them as purchase events – they'll
just be standard custom events.
Step 5: View conversion, purchase, and revenue metrics
After sending a campaign and attributing custom events and purchases to it, you can view conversion, purchase, and revenue metrics:
- For a single campaign, look in the Engagement area of Campaign Analytics.
- For aggregate, cross-campaign metrics, check out Messaging Insights.
Appendix: Finding attribution info
If you're tracking conversions, but you're not using time-based attribution
you'll need to find the relevant campaignId
and templateId
to include when
calling Iterable's event and purchase tracking APIs.
NOTE
Attributing events and purchases to a specific templateId
is useful when
you've associated an experiment with a campaign, since each variation has a
different templateId
.
Option 1: Link parameters
You can use link parameters to pass user, template, and campaign information along with a link click. To do this:
- When editing your campaign content (template), in the Details area, enable the Link Parameters option.
-
Click Add Link Parameter to set up a parameter for each piece of data you'd like to include in the link URL.
For example, you might set Key to
campaignId
and Value to{{campaignId}}
.To identify a user, use a Key of
userId
and Value of{{userId}}
, oremail
and{{hmacSHA1 email}}
(encrypted), depending on your project's unique identifier.
When a user clicks a link in a message, lands on your site, and then completes a specific action or makes a purchase, your server can inspect these URL parameters to find the necessary attribution information.
Option 2: Browser cookies (email-based projects only)
When a user clicks a link in an email campaign, Iterable can set cookies in
the user's web browser to capture their email
, the campaignId
, and the
templateId
.
These cookies can only be used with email campaigns sent by
email-based projects,
and they only work for links that point to a URL with a final destination (for
example, https://example.com/products
) that shares the root URL of your link
tracking domain (for example, https://links.example.com
).
To use attribution cookies, first set up your Iterable project's sending domain, link tracking domain, and associated DNS records. For more information, read Email Setup.
NOTE
Attribution cookies use a UTF-8 encoding scheme.
Iterable sets four attribution-related cookies:
iterableEmailCampaignId
- ThecampaignId
of the Iterable email campaign associated with the link click. Cookie expires in one day.iterableTemplateId
- ThetemplateId
of the Iterable campaign content (template) associated with the link click. Cookie expires in one day.iterableMessageId
- A unique ID associated with a specific send of a specific Iterable campaign to a specific user. Cookie expires in one day. Do not include this value (potentially as amessageId
) when calling Iterable's API to track events and purchases, since Iterable won't save it.-
iterableEndUserId
- The recipient's e-mail address. Cookie expires in one year.IMPORTANT
This cookie is only created for email-based projects, and will be deprecated in a future release. Instead of relying on this cookie for user identification, use link parameters.
When a user clicks a link in an email campaign, lands on your site, and then
completes a specific action or makes a purchase, your server can inspect these
cookies to learn which email
, templateId
, and campaignId
to include when
calling Iterable's custom event or purchase tracking APIs.
Verifying that attribution cookies are set
To verify that attribution cookies are being set as expected:
Send yourself an email campaign (not a proof), and include a link representative the link you'll send in your final campaign.
When you receive the campaign, click the link.
-
Open your browser's developer tools and examine the cookies set for your link tracking domain. For example:
NOTE
The following instructions are specific to the Chrome browser on macOS, but the general pattern is similar for other web browsers, even if the specific terminology or interface differs.
Right-click anywhere on the web page opened by the link and choose Inspect. This open's the browser's developer tools.
On the Application tab of the developer tools, twirl open the Cookies item and select the domain associated with the current page.
-
If you don't see the cookies described above, make sure that Iterable has verified your DNS records, and that the destination of the link in your message shares a root domain with your project's
Iterable has verified your DNS records.
The destination URL of the link included in your message shares a root domain with your project's link tracking domain, as specified in Settings > DNS Setup or Settings > Domains.
For help, read Email Setup. or contact technical support.
Next steps
Next, learn about Adding an Experiment to a Campaign.
Comments
0 comments
Article is closed for comments.