Iterable can attribute purchases to specific campaigns to help you measure the effectiveness of your marketing efforts.
This article describes how to attribute purchase and revenue data to an email campaign and then view the related data in Iterable. For information about tracking purchase events in mobile apps, see Tracking Events and Purchases with Iterable's Mobile SDKs.
NOTE
To track purchases as conversions, you need to use iterable_purchase
for the
conversion event name as described in
Tracking Custom Conversion Events.
Table of contents
Viewing purchase and revenue metrics
To view revenue and purchase-related metrics for a campaign, look in Campaign Analytics, on the Revenue Breakdown card, in the Engagement section.
NOTES
Purchase and revenue-related metrics only appear when you've saved purchase events to your project by calling
POST /api/commerce/trackPurchase
.If you don't see the Revenue Breakdown card, turn on Show revenue in project settings.
To view aggregate metrics for all of your campaigns, go to Messaging Insights.
Attribute purchases to a campaign or template
After a user makes a purchase, attribute it to a specific campaign and template by completing the steps described here.
Prerequisites
Before tracking purchase and revenue information for your email campaigns, set up your Iterable project's sending domain, link tracking domain, and associated DNS records. This enables Iterable's link tracking domain to set browser cookies that indicate who clicked the link and in which campaign and template. For more information, read Email Setup.
Step 1: Determine the user, campaign, and template associated with the purchase
To attribute a purchase to an email campaign, call Iterable's
POST /api/commerce/trackPurchase
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 these
three things:
- Use browser cookies set by Iterable
- Inspect link parameters set by the campaign
- Use time-based campaign attribution
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 is links.example.com
and the checkout page associated with the link is store.example.com
, your
server can 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.NOTE
Note: This cookie is only created for email-based projects and will be deprecated in a future release. We recommend passing parameters in the URL using Handlebars to identify users instead of relying on this cookie. Read Project Types and Unique Identifiers to learn more.
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 message will have a uniqueiterableMessageId
. Don't include amessageId
when calling the track purchase API, since the API won't save this value. This cookie expires in one day.
To verify that Iterable sets the cookies described above:
Send yourself a live email campaign (not a proof) with a link that's representative of the links 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.
-
If you don't see the cookies described above, 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 > 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, the server won't be able to access cookies if your links direct
users to examplepurchase.com
, but your project's link tracking domain is
example.com
(since these domains don't match).
In these cases, configure your campaign to include link parameters that indicate the user, campaign, and template. To do this:
When editing the campaign's template, enable the Link parameters option, in the Details area.
-
Define a parameter for each piece of data you'd like to pass along with the links in your campaign.
For the parameter's Value, use a static value (such as
discount
) or a Handlebars expression (such as{{templateId}}
or{{email}}
).
Use time-based campaign attribution
To attribute all trackPurchase
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:
-
Select
iterable_purchase
in the Conversion Events box.IMPORTANT
You must specify
iterable_purchase
for the event name to enable time-based purchase and revenue tracking for a campaign. This value maps to Iterable'spurchase
event and, in addition to tracking purchase and revenue metrics, also tracks these events as conversions. Select Attribute any conversion events received within this 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.
Step 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 anemail
oruserId
field.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 theitems
array.
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": "https://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).
Step 3: Analyze purchase and revenue information in Iterable
To view purchase and revenue information for an Iterable campaign:
Navigate to Messaging > Campaigns, open the (active) campaign you're working with, and click View Campaign Performance.
-
Use the drop-down menu to select the conversion metrics you want to pin for Campaign Analytics.
Available purchase and revenue-related metrics include:
- Purchases / M (Total Purchases * 1000 / Total Emails Delivered)
- Revenue / M (Revenue * 1000 / Total Emails Delivered)
- Revenue
- Total Purchases
- Unique Purchases (Number of Unique Purchasers)
- Average Order Value (Revenue / Total Purchases)
Review time-based revenue data on the Revenue Breakdown card in the Engagement page.
Comments
0 comments
Article is closed for comments.