Hits list
Read me! If you're here, it's probably because you're wondering how to send data to AB Tasty's collect API. There's a lot of info in this page, you will most likely be interested by the second half of this documentation labelled as Custom tracking in the table of contents below.
Hits list
Each hit type has its specific set of argument rules, that you should check through those links:
Automatically sent by the Javascript tag:
Custom trackings:
Automatically sent
Campaign
const campaignID = "267276";
const variationID = "873378";
window.abtasty.send("campaign", {
caid: campaignID,
vaid: variationID
});
Generated hit headers:
{
"caid": "267276",
"vaid": "873378",
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"t": "CAMPAIGN",
"vid": "18100217380532936"
}
// A binary file ariane_response.tmp will be generated.
This hit should be sent every time a visitor is submitted to a campaign.
Campaign hits are automatically triggered by the Javascript tag with the window.abtasty.send
function. However, you may want to trigger hits manually. For that, just put the function in your code.
[Tag-specific] Hit is automatically sent every time a campaign is applied to the visitor.
Common arguments
A campaign hit must implement the Common arguments
Common argument 't' (type) must be set to '
campaign
'
Campaign ID
The campaign ID is the ID of the test.
Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterCampaignID for this argument.
caid
string
None
None
campaign
Example usage: caid="262762"
Variation ID
The variation ID associated to the campaignID seen by the user.
Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterVariationID for this argument.
vaid
string
None
None
campaign
Example usage: vaid=287622
Pageview
window.abtasty.send("pageview", {});
Generated hit headers
{
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
"t": "PAGEVIEW",
"vid": "18100217380532936"
}
A binary file ariane_response.tmp will be generated.
This hit should be sent every time the visitor arrives on a new page (or 'screen' for mobile apps).
[Tag-specific] - Hit is automatically sent every time the url changes (valid also for SPA).
Page hits are automatically triggered by the Javascript tag. However, you may want to trigger hits manually on some cases.
Common arguments
A pageview hit must implement the Common arguments
Common argument 't' (type) must be set to '
pageview
'
Redirection exception
When the current page is the target of a redirection, two specifics arguments will be sent to cancel this pageview on the data pipeline collection.
Post-edit Action
String of a post edit action. Used for redirection data correction.
pea
string
None
None
pageview
Post-edit Value
Post-edit View. Used with pea. String of a logicalView, target of the post-edit action. Used for redirection data correction.
pev
string
None
None
pageview
Datalayer
window.abtasty.send("datalayer", {
dlr: {
userType: "premium",
userSex: "female"
}
// you can also override other arguments here
});
Type of response you will have
// 200 OK
// A binary file ariane_response.tmp will be generated.
This hit is used to get user segments (e.g. DMP) in order to improve user targeting, segmentation, and enrich campaign reporting interfaces.
Endpoint
The datalayer hit has a different endpoint (i.e. /datalayer
) than the others hits.
Common arguments
A datalayer hit must implement the Common arguments
Common argument 't' (type) must be set to '
DATALAYER
'
Required for datalayer hit type
The content of the datalayer variable
dlr
object/array
None
None
datalayer
Examples of values:
{"userType": "premium", "userSex": "female"}
[{"userType": "premium", "userSex": "female"},{"pageType":"homepage","env":"prod"}]
Example usage: dlr={"userType": "premium", "userSex": "female"}
Client-side implementation
The Datalayer hit is not automatically triggered for all the visitors. We implement a random value to send it for 1% of the viewed pages.
Batch
As part of our ongoing efforts to improve data security and prevent bot traffic, it is now mandatory to include a specific 'User-Agent' header in your CURL requests when sending data to ariane.
curl -X POST \
https://ariane.abtasty.com/ \
-H 'content-type: application/json' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36' \
-d '{
"c": {"342395": "0","339303": "0"},
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"vid": "18100217380532936",
"dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
"h": [
{
"qt": 700,
"t": "PAGEVIEW"
},
{
"caid": "267276",
"vaid": "873378",
"qt": 200,
"t": "CAMPAIGN"
}
],
"t": "BATCH"
}' --output ariane_response.tmp
Type of response you will have
// 200 OK
// A binary file ariane_response.tmp will be generated.
This is a special type of hits used to form batches of other hits and thus isn't a processable hit in itself.
Upon reception, the pipeline will unpack the batch by merging all its informations with its children, then the child hits will be processed as if they were sent separately.
In the previous example two hits will be processed: a PAGEVIEW hit and a CAMPAIGN hit
Both hits will be composed with all the informations contained at the batch level except the argument "h"
which contains the batch's child hits:
{
"c": {"342395": "0","339303": "0"},
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"vid": "18100217380532936",
"dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
"t": "PAGEVIEW"
}
{
"c": {"342395": "0","339303": "0"},
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"vid": "18100217380532936",
"dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
"caid": "267276",
"vaid": "873378",
"t": "CAMPAIGN"
}
The child hit's timestamps will be calculated upon reception using the "qt"
argument. Its value represents the time delta (in milliseconds) between the moment the child hit occured and the moment the batch was sent.
Common arguments
A batch hit must implement the Common arguments
Common argument 't' (type) must be set to '
BATCH
'
Required for batch hit type
The batch can contain all informations its it children have in common except "t"
and "qt"
.
h
array of objects
None
None
batch
Example of values:
[{"qt": 700, "t": "PAGEVIEW"},{"qt": 500, "t": "PAGEVIEW"},{"qt": 7100, "t": "PAGEVIEW"}]
Example usage: h=[{"qt": 700, "t": "PAGEVIEW"},{"qt": 500, "t": "PAGEVIEW"},{"qt": 7100, "t": "PAGEVIEW"}]
Required for the batch's children
The batch's children may ommit all informations they have in common by moving those on the batch level.
The "qt"
value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The "qt"
value must be greater than or equal to 0.
Values greater than four hours may lead to hits not being processed.
qt
integer
None
None
batch children
Custom Trackings
Event
An event can be anything you want, from a click to a newsletter subscription. It basicallys says: "something happened". It will be used as an (Custom) Action Tracking goal in AB Tasty's reporting.
If you're wanting to track something, that's probably what you want to implement.
You can also trigger an Event
using the following function from the tag:
ABTastyClickTracking('eventName', null, 'testId')
window.abtasty.send("event", {
ec: "Action Tracking",
ea: "Click on CTA",
el: "CTA on product page",
ev: 1
});
Common arguments
A event hit must implement the Common arguments
Common argument
t
(type) must be set to 'event
'
Event Category
ec
string
None
150 Bytes
event
Example usage:
ec=Action Tracking
Event Action
This corresponds to the display name of an Action Tracking goal in the AB Tasty platform.
ea
string
None
500 Bytes
event
Example usage:
ea=Click on CTA
Event Label
el
string
None
500 Bytes
event
Example usage:
el=CTA on product page
Event Value
ev
int (>0)
None
500 Bytes
event
Example usage:
ev=1
Segment
This hit is used to share you user segments (think: DMP) with ABTasty in order to enrich your campaigns reportings. This will be referred as "visitors attributes" in the reporting interface, not to be confused with the "segments" you can create in the interface that are a set of saved targetings.
window.abtasty.send("segment", {
s: {
userType: "premium",
userSex: "female"
}
// you can also override other arguments here
});
Common arguments
A segment hit must implement the Common arguments
Common argument 't' (type) must be set to '
segment
'
Segments
Any number of segments (key/value).
s[segmentKey]
string
None
150 Bytes
segment
Example usage: s[userprivilege]=premium
Transaction
A transaction hit, referred as "transaction tag", is set by the customer to be sent whenever a visitor completes a transaction. It is usually implemented on a payment confirmation page but can be use elsewhere to send transactional data and doesn't require a transaction value.
This will populate a transaction goal in the AB Tasty platform.
A transaction can be linked to other Item
hits to specify the products of the transaction (see Item).
window.abtasty.send("transaction", {
tid: "OD564", //Transaction ID
ta: "Purchase", //Transaction Affiliation - Name of the transaction goal
tr: 15.47, //Transaction Revenue
ts: 3.5, //Transaction Shipping
tt: 2.60, //Transaction Tax
tc: "EUR", //Transaction Currency
tcc: "Coupon", //Transaction Coupon Code
pm: "Paypal", //Transaction Payment Method
sm: "Fedex", //Transaction Shipping Method
icn: 12 //Number of items
});
Common arguments
A transaction hit must implement the Common arguments
Common argument 't' (type) must be set to '
transaction
'
Transaction ID
The transaction ID.
tid
string
None
500 Bytes
transaction, item
Example usage: tid=OD564
Transaction affiliation
Specifies the affiliation or store name. This will be the name of your transaction goal.
ta
string
None
500 Bytes
transaction
Example usage: ta=Purchase
Transaction revenue
Specifies the total revenue associated with the transaction. This value should include any shipping or tax costs.
tr
float
0
None
transaction
Example usage: tr=15.47
Transaction shipping
Specifies the total shipping cost of the transaction.
ts
float
0
None
transaction
Example usage: ts=3.50
Transaction tax
Specifies the total tax of the transaction.
tt
float
0
None
transaction
Example usage: tt=2.60
Transaction currency
When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.
tc
string
None
10 Bytes
transaction
Example usage: tc=EUR
Payment Method
Indicate the payment method.
pm
string
None
10 Bytes
transaction
Example usage: pm="Paypal"
Shipping Method
Indicate the shipping method.
sm
string
None
10 Bytes
transaction
Example usage: sm="express"
Item count number
Indicate the number of items in the transaction.
By default, the value will be 1
unless ITEM
hits are attached to this transaction (binded with tid
). In that case, this parameter will be equal to the sum of all attached ITEM
hits.
icn
int
1 or sum of attached ITEM
hits
None
transaction
Example usage: icn=12
Item
Item usually represents a product. An item must be associated with a transaction by its transaction ID (seeTransaction tag implementation).
window.abtasty.send("item", {
tid: "OD564", //transaction ID
in: "Shoe", //Item Name
ip: 3.5, //Item Price
iq: 4, //Item Quantity
ic: "SKU47", //Item Code (SKU)
iv: "Blue" //Item Category
});
Common arguments
An item hit must implement the Common arguments
Common argument 't' (type) must be set to '
item
'
Transaction ID
The transaction
hit matching the tid
argument must have been triggered beforehand or the hit will not be sent.
The transaction ID. This argument links the item to a transaction
tid
string
None
500 Bytes
transaction, item
Example usage: tid=OD564
Item Name
Specifies the item name.
in
string
None
500 Bytes
item
Example usage: in=Shoe
Item Code
Specifies the SKU or item code.
ic
string
None
500 Bytes
item
Example usage: ic=SKU47
Item Price
Specifies the price for a single item / unit.
ip
float
0
None
item
Example usage: ip=3.50
Item Quantity
Specifies the number of items purchased.
iq
integer
0
None
item
Example usage: iq=4
Item Category
Specifies the category that the item belongs to.
iv
string
None
500 Bytes
item
Example usage: iv=Blue
NPS
This hit is most likely to be sent by the NPS widget eventhough you can build your own NPS tracking and get the result in our NPS reporting.
window.abtasty.send("nps", {
nid: "OD564", // NPS ID
ns: 4, // NPS Score
nf: "awesome!", // NPS Feedback
});
Common arguments
An nps hit must implement the Common arguments
Common argument 't' (type) must be set to '
nps
'
NPS ID
The nps ID.
nid
text
None
500 Bytes
nps
Example usage: nid=OD564
NPS Score
Specifies the nps score.
ns
integer
0
None
nps
Example usage: ns=4
NPS Feedback
The nps Feedback.
nf
text
None
500 Bytes
nps
Example usage: nf=awesome!
Product
This hit is meant to be used with the abandoned cart native targeting criterion.
window.abtasty.send("product", {
pit: "CART_ITEM",
pcid: "CARTPROD0001",
pq: 5,
pp: 15.99,
ps: "ECOMPROD00001",
pn: "MyProduct"
});
Common arguments
An product hit must implement the Common arguments
Common argument 't' (type) must be set to '
product
'
Product interaction type
Specifies the type of interaction. Only three values possible: CART_ITEM
, CART_TOTAL
or VIEW
.
pit
String
None
None
product
Example usage: pit=CART_ITEM
Product cart Id
pcid
string
None
None
product
Example usage: pcid=CARTPROD0001
Product quantity
pq
integer
None
None
product
Example usage: pq=5
Product price
When
pit=CART_ITEM
you should put the product price.When
pit=CART_TOTAL
you should put the total price of the cart.
pp
float
None
None
product
Example usage: pp=15.99
Product SKU
ps
String
None
100 Bytes
product
Example usage: ps=ECOMPROD00001
Product name
pn
String
None
100 characters
product
Last updated
Was this helpful?