When sending email campaigns with Iterable, you may want to include links that encourage people to make purchases on your site. Iterable can attribute purchases to specific campaigns, and you can use this data to measure the effectiveness of your marketing efforts.
This document describes how to attribute purchase and revenue data to an email campaign and view this data in Iterable.
Table of contents
Prerequisites
Before tracking purchase and revenue information associated with your Iterable email campaigns, set up your Iterable project's sending domain, link tracking domain, and associated DNS records.
-
If you're using Amazon SES (Iterable's default provider) to send email:
-
In Settings > Project Settings, specify your Custom Project Sending Domain.
-
Work with your web hosting provider to configure DNS records for the entries specified in Settings > DNS Setup.
Wait for Iterable to verify your DNS records. To know when this is done, examine the Verified column of the Settings > DNS Setup page.
-
-
If you're using an alternative ESP to send email:
-
In Settings > Mail Domains, specify your sending and tracking domains. For more information, read Sending Domains, Tracking Domains and Deep Links.
Contact support@iterable.com to discuss the DNS records that must be configured.
Make sure Iterable verifies your DNS records. To do so, examine the Verified column of the Settings > Mail Domains page.
-
Overview
After a user makes a purchase, attribute it to a specific campaign and template by doing the following things:
1. Determine the user, campaign, and template associated with the purchase
To attribute a purchase to a campaign, you'll need to call Iterable's track purchase API and provide details about the relevant purchase, user, campaign, and template.
To determine the correct values to pass to this API, do one of three things:
-
Use browser cookies set by Iterable
Iterable sets browser cookies for your link tracking domain to indicate who clicked the link and in which campaign and template.
-
Inspect link parameters set by the campaign
Iterable campaigns can be configured to pass pertinent information in the URL of the links embedded in your messages.
-
Use time-based campaign attribution
With time-based attribution, Iterable attributes all track purchase API calls made within a specific timeframe to a pre-selected campaign.
These options are described below.
Use browser cookies set by Iterable
When a user clicks a link in an email from an Iterable campaign, Iterable sets browser cookies on your link tracking domain. These cookies describe who clicked the link and in which campaign and template.
If the link's final URL shares a root domain with your Iterable project's link tracking domain, you can use the values stored in these cookies to attribute any purchases made by the user back to the relevant campaign.
For example, if your project's link tracking domain were links.example.com
and the checkout page associated with the link were store.example.com
, your
server could access these cookies and use their values when calling the track
purchase API.
Iterable sets the following cookies:
-
iterableEndUserId
- The recipient's e-mail address
- This cookie expires in one year.
-
iterableEmailCampaignId
- The unique ID associated with the email's campaign in Iterable
- This cookie expires in one day.
-
iterableTemplateId
- The unique ID associated with the email's template in Iterable
- This cookie expires in one day.
-
iterableMessageId
- A unique ID associated with a specific send of a specific Iterable
campaign to a specific user. If the same user ever
receives the same campaign more than once, each will have a unique
iterableMessageId
. - Do not include a
messageId
when calling the track purchase API; the API will not save this value. - This cookie expires in one day.
- A unique ID associated with a specific send of a specific Iterable
campaign to a specific user. If the same user ever
receives the same campaign more than once, each will have a unique
Verifying the existence of the cookies
To verify that Iterable sets the cookies described above, do the following:
Send yourself a live email campaign (not a proof) with a link representative of those that will be used in your campaigns.
After you receive the campaign, click the link.
-
Open your browser's developer tools and examine the cookies set for your link tracking domain.
NOTE
The following instructions are specific to the Chrome browser on macOS, but the general pattern should be similar for other web browsers, even if the specific terminology 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.
-
You should see the cookies described above. If not, check the following:
- Make sure that Iterable has verified your DNS records (see Prerequisites).
- Check that the root domain of the link (in the message) matches your sending domain (as specified in Settings > DNS Setup or Settings > Mail Domains.
- For more help, contact support@iterable.com.
Inspect link parameters set by the campaign
If a link in your email campaign points to a URL that has a different root domain than your Iterable project's link tracking domain, the server for the destination URL won't be able to access the cookies that describe the user, campaign, or template (since those cookies are set for the link tracking domain).
For example, this would be true if your links direct users to
examplepurchase.com
, but your project's link tracking domain is example.com
(since these domains do not match).
In these cases, configure your campaign to include link parameters that indicate the user, campaign, and template. To do this:
When editing a template, navigate to the Advanced Options tab.
Click the Enable Custom Link Parameters button.
-
Set up the link parameters you'd like to pass along with the link click.
- On the left-hand side of the form, specify the name of the link parameter.
- On the right-hand side of the form, use Handlebars to specify
{{campaignId}}
,{{templateId}}
,{{email}}
, or other fields (as necessary).
Use time-based campaign attribution
To attribute all track purchase API calls within a specific timeframe to a pre-determined campaign and template, use time-based attribution.
API calls that specify a different campaignId
or an email address not
included on the campaign in question will not have their purchase or revenue
data counted against the campaign for which time-based attribution was enabled.
Time-based attribution may be less accurate than other forms of purchase and revenue tracking. Within the specified timeframe, any user who receives the campaign—regardless of whether or not they open it—will have their purchases count against the campaign.
To set up time-based campaign attribution:
When setting up a campaign, check Use a Custom Conversion Metric.
-
Enter
iterable_purchase
in the Custom Conversion Event box.IMPORTANT
You must specify
iterable_purchase
for the event name. This specific name causes Iterable to enable time-based purchase and revenue tracking for the campaign. Select Any iterable_purchase Events Received Within the Attribution Period.
Specify an Attribution Period (a number of hours between 1 and 168).
NOTES
If you send multiple emails to a single user, and each one has a different
iterable_purchase
time-based attribution period, Iterable will attribute that user's purchases to the most recently sent campaign that has an active attribution period.If a track purchase API call specifies a
campaignId
, Iterable attributes the purchase to that campaign (regardless of any open time-based attribution periods).If the user specified in the API call was not sent the campaign in question, Iterable will not attribute that purchase to the campaign.
2. Call Iterable's track purchase API
After a purchase has been made and you've determined the relevant user,
campaign, and template (or you've set up time-based campaign attribution),
call Iterable's POST /api/commerce/trackPurchase
to associate all of this data.
In particular, the JSON body of a request to this endpoint should include the following fields:
-
user
- The user to which the purchase should be associated; this object must
have either an
email
oruserId
field
- The user to which the purchase should be associated; this object must
have either an
-
campaignId
- The Iterable campaign ID to which the purchase should be associated
-
templateId
- The Iterable template ID to which the purchase should be associated
-
total
- The amount of revenue to associate with the purchase. Note that Iterable
does not sum up the prices and quantities found in the
items
array.
- The amount of revenue to associate with the purchase. Note that Iterable
does not sum up the prices and quantities found in the
For example:
{ "user": { "email": "docs@iterable.com", "dataFields": { "totalPurchases": 5 }, "userId": "1" }, "items": [ { "id": "1", "sku": "1", "name": "Stickers", "description": "Put these stickers anywhere and everywhere!", "categories": [ "stickers", "novelty" ], "price": 5.99, "quantity": 2, "imageUrl": "http://static.iterable.com/iterable-demo-v1/15-03-04-Iterable_stickers.jpg", "url": "iterable.com" } ], "campaignId": 14348, "templateId": 29592, "total": 10, "dataFields": { "shippingAddress1": "71 Stevenson St", "shippingAddress2": "Suite 300", "city": "San Francisco", "state": "CA", "zip": 94105 } }
NOTES
Attributing purchases to a specific template ID is useful when running A/B tests, where each experiment variation has a different template ID.
It is not possible to use this endpoint to associate purchase data with a message ID (the unique ID Iterable associates with a specific send of a specific campaign to a specific user).
-
This endpoint creates
purchase
events associated with the user in question.To list a user's events, either:
- Navigate to Audience > Contact Lookup, search for the user in question, and go to their Event History tab.
- Call
GET /api/events/{email}
.
It is possible to call this endpoint multiple times for the same user. Iterable creates separate
purchase
events for each successful call.If, in a 24-hour period, a user clicks links in multiple emails but only completes a single purchase, Iterable attributes that purchase to the final campaign from which they clicked a link (since that campaign and template is specified by the cookies or link parameters associated with the final click and those values would be passed by your server to the track purchase API).
3. Analyze purchase and revenue information in Iterable
To view purchase and revenue information for an Iterable campaign:
Navigate to Messaging > Campaigns and open the (active) campaign in question. This brings up its Campaign Analytics.
-
Use the drop-down menu to select the metrics related to purchases and revenue:
Available purchase and revenue-related metrics include:
- Revenue
- Total Purchases
- Unique Purchases (number of unique purchasers)
- Average Order Value (revenue / total purchases)
- Purchases / M (total purchases * 1000 / total emails delivered)
- Revenue / M (revenue * 1000 / total emails delivered)
-
Analyze the purchase and revenue statistics:
Push notifications and in-app messages
The instructions in this document apply to email campaigns. To track purchases and revenue for in-app message and push notification campaigns, follow a similar process.
For push notifications, find the
campaignId
andtemplateId
values provided in the notification payload and pass them to the track purchase API.For in-app messages, find the
campaignId
value found in the message payload and send it to the track purchase API. If you need to track thetemplateId
, find it by callingGET /api/users/getSentMessages
for the campaign in question.
Comments
0 comments
Please sign in to leave a comment.