Campaign History
The campaign history is the list of campaignId / variationId pairs a visitor has been exposed to.
Accessing the campaign history
On front-end, the campaign history is stored in the ABTasty
cookie.
Each time a visitor arrives on the website, the cookie is read to match its campaign history and display the campaigns accordingly.
If the cookie doesn't exist or if it is the first time the visitor is exposed to the campaign, the information is written in the cookie depending on its variation attribution.
The campaign history can also be accessed using the following command.
ABTasty.getCampaignHistory();
{
696943: '864650',
762343: '947523'
}
In this example, the visitor has seen variation 864650
of campaign 696943
and variation 947523
of campaign 762343
.
Differences between the cookie and the JS object
The campaign history from the cookie and the JS object may differ.
The JS object can only contains campaigns that are currently running on your AB Tasty account. If you pause a campaign, it will automatically be removed from the list, even if the visitor has been exposed just before.
ABTasty.results
However, in the cookie, we keep a paused campaign in the list for 15 days for attribution purposes. That's why you might see a paused campaign in the cookie and a difference between the JS object and the cookie.
Sending the campaign history to the data pipeline
The JS object is the source of truth when sending a hit to our data collection. For each hit sent, the campaign history will be attached using the c
parameter to be able to attribute a campaign list to each visitor.
{
"c": {
"696943": "864650",
"762343": "947523"
},
"cid": "d5c0fd1919bfd2eae896fd01e4774882",
"vid": "fpg1wga14hkexgq3",
"dr": "",
"vp": "1044x937",
"sr": "1920x1080",
"pt": "PageTitle",
"de": "UTF-8",
"sd": "24-bits",
"ul": "fr-FR",
"je": false,
"dl": "https://www.website.com",
"cst": 1634142376974,
"sn": 3,
"sen": 5,
"lv": "JrowG2w9",
"qa": false,
"h": [
{
"qt": 559,
"sen": 3,
"t": "PAGEVIEW"
},
{
"caid": "762343",
"vaid": "947523",
"qt": 525,
"sen": 4,
"t": "CAMPAIGN",
"qa": false
},
{
"caid": "696943",
"vaid": "864650",
"qt": 514,
"sen": 5,
"t": "CAMPAIGN",
"qa": false
}
],
"t": "BATCH"
}
There are two things to notice:
Campaigns that are untracked (
traffic_rejected
status /variationId==-1
) aren't sent through the campaign history.Master test ID are sent for multipages tests along with their subtests ID.
Edge case
Each time you build a new version of your script, it embeds a list of obsolete campaigns (= campaigns that has been paused). This is how we clean up our cookie from paused campaigns.
To avoid maintaining a constantly growing obsolete campaigns list, we have a fix limit to 125 days until when obsolete campaigns aren't communicated anymore to our tag. If a visitor hasn't come to your website for 125 days and if one or several campaigns have been paused during this period of time, this visitor will keep the campaign information in its campaign history until a manual cleaning is done.
ABTasty.accountData.obsoletes
Last updated
Was this helpful?