NAV
cURL Javascript

Universal Collect

Universal Datacollect aims at providing a unified hit format which can be used using weither your campaigns are using:

The format of the hit is inspired by Google Analytics’ own format

Common arguments

Common arguments are required for EVERY hit type. You should try to know them before reading into hit-specific arguments.

Hits

Each hit type has its specific set of argument rules, that you should check through those links:

Automatically sent by the Javascript tag:
Hits that should be implemented by the client:

Common arguments list

These arguments can be sent with any type of hit. The more data the better. By default, the JS tag sends all of them with every hit.

Summary

Type

Required for all hit type

Type of the hit.

List of possible values for v1 :

Parameter Value Type Default Value Max Length Supported hit types
t string None None all

Example value: pageview

Example usage: t=pageview

Client ID

Required for all hit type

Unique ID of the client. This ID is also the JS tag identifier.

Parameter Value Type Default Value Max Length Supported hit types
cid string None None all

Example value: b0711162425441fb679dc41b98f052ab

Example usage: cid=b0711162425441fb679dc41b98f052ab

Visitor ID

Required for all hit type

Unique ID of the visitor

Parameter Value Type Default Value Max Length Supported hit types
vid string None None all

Example value: as8eknlll

Example usage: vid=as8eknlll

Protocol Version

Optional for all hit type

Protocol version. This will only change when there are changes that are not backwards compatible.

Parameter Value Type Default Value Max Length Supported hit types
v integer 1 None all

Example value: 1

Example usage: v=1

Data Source

Optional for all hit types

Data source type. Can be web or app.

Parameter Value Type Default Value Max Length Supported hit types
ds string web None all

Example value: web

Example usage: ds=web

User IP

Optional for all hit types

The IP address of the user. This should be a valid IP address in IPv4 or IPv6 format. It will always be anonymized.

Parameter Value Type Default Value Max Length Supported hit types
uip string None None all

Example value: 52.311.94.68

Example usage: uip=52.211.94.68

Document Referrer

Optional for all hit types

Specifies which referral source brought traffic to a website. This value is also used to compute the traffic source. The format of this value is a URL.

Parameter Value Type Default Value Max Length Supported hit types
dr string None 2048 Bytes all

Example value: http://example.com

Example usage: dr=http%3A%2F%2Fexample.com

Viewport Size

Optional for all hit types

Specifies the viewable area of the browser / device (in pixels).

Parameter Value Type Default Value Max Length Supported hit types
vp string None 20 Bytes all

Example value: 123x456

Example usage: vp=123x456

Screen resolution

Optional for all hit types

Specifies the screen resolution (in pixels).

Parameter Value Type Default Value Max Length Supported hit types
sr string None 20 Bytes all

Example value: 800x600

Example usage: sr=800x600

Page Title

Web: Required for `pageview` hit types

App: Not supported

The title of the page / document.

Note: The JS tag uses document.title.

Parameter Value Type Default Value Max Length Supported hit types
pt string None 1500 Bytes all

Example value: Settings

Example usage: pt=Settings

Document Encoding

Web: Optional for all hit types

App: Not supported

Specifies the character set used to encode the page / document.

Parameter Value Type Default Value Max Length Supported hit types
de string UTF-8 20 Bytes all

Example value: UTF-8

Example usage: de=UTF-8

Screen Color Depth

Optional for all hit types

Specifies the screen color depth.

Parameter Value Type Default Value Max Length Supported hit types
sd string None 20 Bytes all

Example value: 24-bits

Example usage: sd=24-bits

User Language

Optional for all hit types

Specifies the language.

Parameter Value Type Default Value Max Length Supported hit types
ul string None 20 Bytes all

Example value: en-us

Example usage: ul=en-us

Java Enabled

Optional for all hit types

Specifies whether Java was enabled.

Parameter Value Type Default Value Max Length Supported hit types
je boolean None None all

Example value: 1

Example usage: je=1

Flash Version

Optional for all hit types

Specifies the flash version.

Parameter Value Type Default Value Max Length Supported hit types
*fl** string None 20 Bytes all

Example value: 10 1 r103

Example usage: fl=10%201%20r103`

Queue Time

Optional for all hit types

Used to collect offline / latent hits. The value represents the time delta (in milliseconds) between when the hit being reported occurred and the time the hit was sent. The value must be greater than or equal to 0. Values greater than four hours may lead to hits not being processed.

Parameter Value Type Default Value Max Length Supported hit types
qt integer None None all

Example value: 560

Example usage: qt=560

Campaign ID

[scope:tag] Required for all hit types

[scope:server-side] Not Required

Combinable argument. Key is dynamic and has to match a campaign ID. Value is the matching variation ID. Sending this argument means ‘The user saw this campaign with this variation at one point’.

Parameter Value Type Default Value Max Length Supported hit types
c[campaign_id] string None None all

Example value: 873579

Example usage: c[287273]=873579

Document Location url

Optional

Current URL of the page, at the moment the hit is sent.

Note: server will compute more information from this url, such as domain name, url path, list of parameters, etc.

Parameter Value Type Default Value Max Length Supported hit types
dl string None 2048 Bytes all

Example value: https://abtastylab.com/b0711162425441fb679dc41b98f052ab/

Example usage: dl=https%3A%2F%2Fabtastylab.com%2Fb0711162425441fb679dc41b98f052ab%2F

Current Session Timestamp

Optional for all hit types

Unix Timestamp of the current session

Note: the JS tag uses a cookie to write and read this data.

Parameter Value Type Default Value Max Length Supported hit types
cst Integer None None all

Example value: 1522053173006

Example usage: cst=1522053173006

Session Number

Optional for all hit types

Number of the current session for the current visitor.

Note: the JS tag uses a cookie to write and read this data.

Parameter Value Type Default Value Max Length Supported hit types
sn Integer None None all

Example value: 6

Example usage: sn=6

Custom Dimension

Optional for all hit types

Each custom dimension has an associated index. There is a maximum of 20 custom dimensions. The dimension index must be a positive integer between 1 and 20, inclusive.

Parameter Value Type Default Value Max Length Supported hit types
cd[dimensionIndex] string None 150 Bytes all

Example value: Sports

Example usage: cd[1]=Sports

Custom Metric

Optional for all hit types

Each custom metric has an associated index. There is a maximum of 20 custom metrics. The metric index must be a positive integer between 1 and 20, inclusive.

Parameter Value Type Default Value Max Length Supported hit types
cm[dimensionIndex] number None None all

Example value: 47

Example usage: cm[1]=47

Session Event Number

[scope:tag] Required for all hit types

[scope:server-side] Not Required

Tag Only argument. Required when hits are sent from the Javascript tag. Inside a user session, every hit should increment a global counter to keep track of event numbers. A new session will reset this counter to zero.

Parameter Value Type Default Value Max Length Supported hit types
sen number None None all

Example value: 23

Example usage: sen=23

Hits

Automatically sent by the Javascript tag:

Campaign

Code implementation:

curl -X POST   https://ariane.abtasty.com   -H 'Content-Type: text/plain'   -H 'Postman-Token: 0d1d0de3-30d3-406a-85a1-90598b03ad87'   -H 'cache-control: no-cache'   -d '{
"caid": "267276",
"vaid": "873378",
"cid": "60511af14f5e48764b83d36ddb8ece5a",
"t": "CAMPAIGN",
"vid": "18100217380532936"
}' --output ariane_response.tmp
const campaignID = "267276";
const variationID = "873378";

window.abtasty.send("campaign", {
  caid: campaignID,
  vaid: variationID
});

Below an example of response:

{
"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.

Arguments

Common arguments

Campaign ID

Required for campaign hit type

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.

Parameter Value Type Default Value Max Length Supported hit types
caid string None None campaign

Example value: "262762"

Example usage: caid="262762"

Variation ID

Required for campaign hit type

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.

Parameter Value Type Default Value Max Length Supported hit types
vaid string None None campaign

Example value: 287622

Example usage: vaid=287622

Page

Code implementation:

window.abtasty.send("pageview");
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "t": "PAGEVIEW",
  "vid": "18100217380532936"
}' --output ariane_response.tmp

Below an example of response:

{
  "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.

Arguments

Common arguments

That’s it !

You read well, ‘pageview’ hit type only need to be sent with the common arguments.

Visitor event

Hit of type visitorevent are actions made by visitors on the webpage, such as a click, a scroll, hovering an element, etc..

@tag-specific: The JS tag sets its own event listeners and automatically collects visitor events. No set-up required.

Arguments

Common arguments

Event type

Required for `visitorevent` hit type

The type of visitor event to collect

Parameter Value Type Default Value Max Length Supported hit types
et ‘scroll’, ‘click’, ‘over’ None None visitorevent

Example value: click

Example usage: et=click

Cursor Position

Required for visitorevent hit type

The cursor coordinates (x and y)

Info: Tag uses pageX and pageY to get the position of the cursor.

Parameter Value Type Default Value Max Length Supported hit types
cp string None None visitorevent

Example value: 340x220

Example usage: cp=340x220

Event Scroll Percent

Required for visitorevent hit type

Percent of scroll of the document when the event is triggered.

Parameter Value Type Default Value Max Length Supported hit types
esp integer None None visitorevent

Example value: 52

Example usage: esp=52

Target arguments

All arguments under this category should be added to any visitorevent hit IF AND ONLY IF the JS event has a target element (example: a click always has a target element).

Target Element CSS Path

Optional

Target element CSS path (unique css selector)

Info: The tag uses its own algorithm to generate a unique selector (as unique as possible)

Parameter Value Type Default Value Max Length Supported hit types
tecp string None None visitorevent

Example value: .module > h2

Example usage: tecp=.module%20%3E%20h2

Target Element ID

Optional

id property of the target element, if any.

Note: Tag uses id property of Element.

Parameter Value Type Default Value Max Length Supported hit types
teid string None None visitorevent

Example value: mainSlider

Example usage: teid=mainSlider

Over Time Before Event

Optional

Number of ms the visitor was hovering the target with the cursor before the event was triggered.

Parameter Value Type Default Value Max Length Supported hit types
otbe integer None None visitorevent

Example value: 231

Example usage: otbe=231

Target Classes

Optional

List of classes of the target DOM Element.

Note: Tag uses className property.

Parameter Value Type Default Value Max Length Supported hit types
tc string None None visitorevent

Example value: field-ignore-highlight editable-field inactive

Example usage: tc=field-ignore-highlight%20editable-field%20inactive

Target Element Size

Optional

Target element Size, indicated in pixels

Info: The tag uses clientHeight and clientWidth

Parameter Value Type Default Value Max Length Supported hit types
tes string None None visitorevent

Example value: 200x100

Example usage: tes=200x100

Target Element Position

Optional

Target element position, indicated in pixels (x and y coordinates)

Info: The tag uses clientLeft and clientTop

Parameter Value Type Default Value Max Length Supported hit types
tep string None None visitorevent

Example value: 10x1203

Example usage: tep=10x1203

Target Element Children Count

Optional

Number of direct children elements in the target element.

Info: The tag uses childElementCount

Parameter Value Type Default Value Max Length Supported hit types
tcec integer None None visitorevent

Example value: 7

Example usage: tcec=7

Target Element Tagname

Optional

Raw HTML tagname of the target element.

Info: The tag uses tagName

Parameter Value Type Default Value Max Length Supported hit types
tet string None None visitorevent

Example value: DIV

Example usage: tet=DIV

Collected events

Here is a list of events collected by the JS tag, as of today. In each case, 'et'(event type) argument requires to be set to a specific value.

Click

Over

Scroll

Performance

Code implementation:

window.abtasty.send("performance");
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "dltt": 0,
  "drl": 814,
  "gca": 0,
  "gct": {207651: 4, 268597: 0, 346331: 13},
  "gsl": 0,
  "ml": {207651: 0, 241727: 0, 268597: 0, 320072: 0, 346331: 0, 372878: 0, 378617: 0, 380768: 0},
  "nc": 453,
  "nq": 0,
  "pgl": {207651: 0, 241727: 0, 268597: 0, 320072: 0, 346331: 0, 372878: 0, 378617: 0, 380768: 0},
  "t": "PERFORMANCE",
  "tdt": 235,
  "tgl": {207651: 1, 241727: 0, 268597: 0, 273170: 0, 273217: 0, 320072: 0, 346331: 0, 372878: 0, 378617: 0},
  "tsi": 0,
  "tssl": 0,
  "ttfb": 8,
  "tti": 262,
  "tv": "2.4"
  "uasl": 0,
}' --output ariane_response.tmp

This hit should be sent every time a visitor is loading a page and modifications are applied. The default timeout before this hit dispatch is 5 second.
All performance values are rounded to an integer.

[Tag-specific] - Hit is automatically sent every time the url changed if “reload on url change” option is activated for account (valid also for SPA).

Arguments

There are two types of metrics for the hit. The first part of arguments is intended for the tag download latency. The values are based on browser [Performance Resource Timing API].
NB: All performance api properties cannot be supported in certain browser. Please, refer to support modification to check measure availability on specific browser.

The other part tracks tag script execution latency.

Common arguments

Tag version

The client tag version.

Parameter Value Type Default Value Max Length Supported hit types
tv string None None performance

Example value: "2.3-ariane"

Example usage: tv="2.3-ariane"

Tag transfer size

Tag script transfer size from Performance Ressource Timing API.

Parameter Value Type Default Value Max Length Supported hit types
tsi number None None performance

Example value: 97392 (95,1 Kb)

Example usage: tsi=97392

Tag Domain Lookup Time

Tag CDN domain lookup time.

Parameter Value Type Default Value Max Length Supported hit types
dltt number None None performance

Example value: 15.69999999992433

Example usage: dltt=16

Tag SSL negotiation

Tag script SSL negotiation. This measure cannot be extremly reliable, because it is calculated based on our own observations.

Parameter Value Type Default Value Max Length Supported hit types
tssl number None None performance

Example value: 15.500000000429281

Example usage: tssl=16

Tag time to first byte

Time passed before first byte of tag script has been downloaded.

Parameter Value Type Default Value Max Length Supported hit types
ttfb number None None performance

Example value: 11.300000000119326

Example usage: ttfb=11

Tag download time

Tag download time as a difference between responseStart and responseEnd.

Parameter Value Type Default Value Max Length Supported hit types
tdt number None None performance

Example value: 59.500000000298314

Example usage: tdt=60

Tag total download time

Tag total tag download time. According to the MDN Performance Resource Timing API, this option should be equal to tag download time.

Parameter Value Type Default Value Max Length Supported hit types
tti number None None performance

Example value: 127.1999999999025

Example usage: tti=127

Tag account global code latency

Account global code execution time.

Parameter Value Type Default Value Max Length Supported hit types
gca number 0 None performance

Example value: 12.199

Example usage: gca=13

Tag User Agent service latency

The user agent service response time.

Parameter Value Type Default Value Max Length Supported hit types
uasl number 0 None performance

Example value: 137.099999999902

Example usage: uasl=137

Tag geolocation service latency

The geolocation service responce time.

Parameter Value Type Default Value Max Length Supported hit types
gsl number 0 None performance

Example value: 127.1999999999025

Example usage: gsl=127

Nirror tag script latency

Nirror tag script download time.

Parameter Value Type Default Value Max Length Supported hit types
nc number 0 None performance

Example value: 127.1999999999025

Example usage: nc=127

Nirror quota service latency

Nirror quota service latency.

Parameter Value Type Default Value Max Length Supported hit types
nq number 0 None performance

Example value: 132.1999999999025

Example usage: nq=132

Tag DOMReady timing

Time before the tag DOMReady event fires.

Parameter Value Type Default Value Max Length Supported hit types
drl number 0 None performance

Example value: 127

Example usage: drl=127

Tag adblock latency

Time to check if adblock is activeted in the user browser

Parameter Value Type Default Value Max Length Supported hit types
abdl number 0 None performance

Example value: 12.1

Example usage: abdl=12

Tag test global code latency

Time to apply test global code.

Parameter Value Type Default Value Max Length Supported hit types
gct string None None performance

Example value: gct = { 13265: 234, 34782: 700.1 }

Example usage: "gct":{"13265":234,"34782": 700 }

Tag modification latency

Time to apply normal editor modifications (e.g. edit text, add link, change style, …).

Parameter Value Type Default Value Max Length Supported hit types
ml string None None performance

Example value: ml = { 13265: 234, 34782: 700.1 }

Example usage: "ml":{"13265":234,"34782": 700 }

Tag widgets latency

Time to apply widgets (plugins) on every test.

Parameter Value Type Default Value Max Length Supported hit types
pgl string None None performance

Example value: pgl = { 13265: 234, 34782: 700.1 }

Example usage: "pgl":{"13265":234,"34782": 700 }

Tag link with analytics latency

The timing for analytics link per test.

Parameter Value Type Default Value Max Length Supported hit types
all string None None performance

Example value: all = { 13265: 234, 34782: 700.1 }

Example usage: "all":{"13265":234,"34782": 700 }

Tag targeting latency

Time to execute targeting check code and wait for targeting result (not pending status).

Parameter Value Type Default Value Max Length Supported hit types
tgl string None None performance

Example value: tgl = { 13265: 234, 34782: 700.1 }

Example usage: "tgl":{"13265":234,"34782": 700 }

Batch

Code implementation:

curl -X POST \
  https://ariane.abtasty.com/ \
  -H 'content-type: application/json' \
  -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.

Arguments

Common arguments

Required for batch hit type

The batch can contain all informations its it children have in common except "t" and "qt".

Parameter Value Type Default Value Max Length Supported hit types
h array of objects None None batch

Example of values:

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.

Parameter Value Type Default Value Max Length Supported hit types
qt integer None None batch children

Hits that should be implemented by the client:

Datalayer

Code implementation:

curl -X POST \
  https://ariane.abtasty.com/datalayer \
  -H 'content-type: application/json' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "dlr": {"userType": "premium", "userSex": "female"}
  "t": "DATALAYER",
  "vid": "18100217380532936"
}' --output ariane_response.tmp
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.

Arguments

Common arguments

Required for datalayer hit type

The content of the datalayer variable

Parameter Value Type Default Value Max Length Supported hit types
dlr object/array None None datalayer

Examples of values:

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. Here is how you can trigger one from your source-code:

Segment

Code implementation:

window.abtasty.send("segment", {
  s: {
    userType: "premium",
    userSex: "female"
  }
  // you can also override other arguments here
});
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d 'window.abtasty.send("segment", {
  s: {
    userType: "premium",
    userSex: "female"
  }
});'--output ariane_response.tmp

Below an example of response:

{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "s": {
    "userType": "premium", "userSex": "female"
        },
  "t": "SEGMENT",
  "vid": "18100217380532936",
}
// A binary file ariane_response.tmp will be generated.

This hit is used to share you user segments (think: DMP) with ABTasty, in order to improve user targeting, segmentation, and enrich your campaigns reportings interfaces.

Segment hits are not automatically triggered for now. Here is how you can trigger one from your source-code.

Arguments

Common arguments

Segments

Required for segment hit type

Any number of segments (key/value).

Parameter Value Type Default Value Max Length Supported hit types
s[segmentKey] string None 150 Bytes segment

Example value: premium

Example usage: s[userprivilege]=premium

Transaction

Code implementation:

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
});
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "icn": 12,
  "pm": "Paypal",
  "sm": "Fedex",
  "t": "TRANSACTION",
  "ta": "Purchase",
  "tc": "EUR",
  "tcc": "Coupon",
  "tid": "OD564",
  "tr": 15.47,
  "ts": 3.5,
  "tt": 2.6,
  "vid": "18100217380532936"
}' --output ariane_response.tmp

Below an example of response:

{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "icn": 12,
  "pm": "Paypal",
  "pt": "Home%20%7C%20Luxury%20Travel%20Site",
  "sm": "Fedex",
  "t": "TRANSACTION",
  "ta": "Purchase",
  "tc": "EUR",
  "tcc": "Coupon",
  "tid": "OD564",
  "tr": 15.47,
  "ts": 3.5,
  "tt": 2.6,
  "vid": "18100217380532936"
}
// A binary file ariane_response.tmp will be generated.

A transaction is manually set by the customer to be sent whenever a visitor completes a transaction.

A transaction can be linked to other Item hits to specify the products of the transaction (see item event documentation).

Arguments

Common arguments

Transaction ID

Required for `transaction` hit type and for `item` hit type when `action`=`confirmation`

The transaction ID.

Parameter Value Type Default Value Max Length Supported hit types
tid string None 500 Bytes transaction, item

Example value: OD564

Example usage: tid=OD564

Transaction affiliation

Required

Specifies the affiliation or store name. This will be the name of your transaction goal.

Parameter Value Type Default Value Max Length Supported hit types
ta string None 500 Bytes transaction

Example value: Purchase

Example usage: ta=Purchase

Transaction revenue

Optional

Specifies the total revenue associated with the transaction. This value should include any shipping or tax costs.

Parameter Value Type Default Value Max Length Supported hit types
tr float 0 None transaction

Example value: 15.47

Example usage: tr=15.47

Transaction shipping

Optional

Specifies the total shipping cost of the transaction.

Parameter Value Type Default Value Max Length Supported hit types
ts float 0 None transaction

Example value: 3.50

Example usage: ts=3.50

Transaction tax

Optional

Specifies the total tax of the transaction.

Parameter Value Type Default Value Max Length Supported hit types
tt float 0 None transaction

Example value: 2.60

Example usage: tt=2.60

Transaction currency

Optional

When present indicates the local currency for all transaction currency values. Value should be a valid ISO 4217 currency code.

Parameter Value Type Default Value Max Length Supported hit types
tc string None 10 Bytes transaction

Example value: EUR

Example usage: tc=EUR

Payment Method

Optional

Indicate the payment method

Parameter Value Type Default Value Max Length Supported hit types
pm string None 10 Bytes transaction

Example value: Paypal

Example usage: pm="Paypal"

Shipping Method

Optional

Indicate the shipping method

Parameter Value Type Default Value Max Length Supported hit types
sm string None 10 Bytes transaction

Example value: express

Example usage: sm="express"

Item count number

Optional

Indicate the number of item

Parameter Value Type Default Value Max Length Supported hit types
icn int None None transaction

Example value: 12

Example usage: icn=12

Item

Below an example of client-side 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
});
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ic": "SKU47",
  "in": "Shoe",
  "ip": 3.5,
  "iq": 4,
  "iv": "Blue",
  "t": "ITEM",
  "tid": "OD564",
  "vid": "18100217380532936"
}' --output ariane_response.tmp

Below an example of response:

{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ic": "SKU47",
  "in": "Shoe",
  "ip": 3.5,
  "iq": 4,
  "iv": "Blue",
  "t": "ITEM",
  "tid": "OD564",
  "vid": "18100217380532936"
}
// A binary file ariane_response.tmp will be generated.

Item usually represents a product. An item must be associated with a transaction (see transaction event documentation).

Arguments

Common arguments

Transaction ID

Required for `item` and `transaction` hit types

Required for `transaction` hit type

The transaction ID. This argument allows the item to be linked to a transaction

Parameter Value Type Default Value Max Length Supported hit types
tid string None 500 Bytes transaction, item

Example value: OD564

Example usage: tid=OD564

Item Name

Required for `item` hit type

Specifies the item name.

Parameter Value Type Default Value Max Length Supported hit types
in string None 500 Bytes item

Example value: Shoe

Example usage: in=Shoe

Item Price

Optional

Specifies the price for a single item / unit.

Parameter Value Type Default Value Max Length Supported hit types
ip float 0 None item

Example value: 3.50

Example usage: ip=3.50

Item Quantity

Optional

Specifies the number of items purchased.

Parameter Value Type Default Value Max Length Supported hit types
iq integer 0 None item

Example value: 4

Example usage: iq=4

Item Code

Optional

Specifies the SKU or item code.

Parameter Value Type Default Value Max Length Supported hit types
ic string None 500 Bytes item

Example value: SKU47

Example usage: ic=SKU47

Item Category

Optional

Specifies the category that the item belongs to.

Parameter Value Type Default Value Max Length Supported hit types
iv string None 500 Bytes item

Example value: Blue

Example usage: iv=Blue

Nps

Below an example of client-side implementation:

window.abtasty.send("nps", {
  nid: "OD564",     //nps ID
  ns: 4,            //Nps Score
  nf: "awesome!",   //Nps Feedback
  caid: "262762",   //campaign ID
  vaid: "873378"    //variation ID
});
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "nid": "OD564",
  "ns": 4,
  "nf": "awesome!",
  "t": "NPS",
  "vid": "18100217380532936", 
  "caid": "262762",
  "vaid": "873378"
}' --output ariane_response.tmp

Below an example of response:

{
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "nid": "OD564",
  "ns": 4,
  "nf": "awesome!",
  "t": "NPS",
  "vid": "18100217380532936",
  "caid": "262762",
  "vaid": "873378"
}
// A binary file ariane_response.tmp will be generated.

Arguments

Common arguments

NPS ID

Optional

The nps ID.

Parameter Value Type Default Value Max Length Supported hit types
nid text None 500 Bytes nps

Example value: OD564

Example usage: nid=OD564

NPS Score

Required for `nps` hit type

Specifies the nps score.

Parameter Value Type Default Value Max Length Supported hit types
ns integer 0 None nps

Example value: 4

Example usage: ns=4

NPS Feedback

Optional

The nps Feedback.

Parameter Value Type Default Value Max Length Supported hit types
nf text None 500 Bytes nps

Example value: awesome!

Example usage: nf=awesome!

Campaign ID

Optional

The campaign ID.

Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterCampaignID for this argument.

Parameter Value Type Default Value Max Length Supported hit types
caid string None None campaign

Example value: "262762"

Example usage: caid="262762"

Variation ID

Optional

The variation ID.

Parameter Value Type Default Value Max Length Supported hit types
vaid string None None campaign

Example value: "873378"

Example usage: vaid="873378"

Event

Below an example of client-side implementation:

window.abtasty.send("event", {
  ec: "User Engagement",
  ea: "newsletterSubscription",
  el: "contains status of user newsletter mode",
  ev: 1,
  caid: "262762",
  vaid: "873378"
});
curl -X POST \
  https://ariane.abtasty.com \
  -H 'content-type: application/json' \
  -d '{
  "caid": "262762",
  "vaid": "873378",
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ea": "newsletterSubscription",
  "ec": "User Engagement",
  "el": "contains status of user newsletter mode",
  "ev": 1,
  "t": "EVENT",
  "vid": "18100217380532936"
}' --output ariane_response.tmp

Below an example of response:

{
  "caid": "262762",
  "vaid": "873378",
  "cid": "60511af14f5e48764b83d36ddb8ece5a",
  "dl": "http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
  "ea": "newsletterSubscription",
  "ec": "User Engagement",
  "el": "contains status of user newsletter mode",
  "ev": 1,
  "t": "EVENT",
  "vid": "18100217380532936"
}
// A binary file ariane_response.tmp will be generated.

An event can be anything you want, from a click to a newsletter subscription.

Arguments

Common arguments

Event Category

Required for event hit type

The event Category.

Parameter Value Type Default Value Max Length Supported hit types
ec string None 150 Bytes event

Event Action

Required for `event` hit type

The Event action

Parameter Value Type Default Value Max Length Supported hit types
ea string None 500 Bytes event

Event Label

Optional

The Event label

Parameter Value Type Default Value Max Length Supported hit types
el string None 500 Bytes event

Event Value

Optional

The Event value. Value must be non-negative.

Parameter Value Type Default Value Max Length Supported hit types
ev int None 500 Bytes event

Campaign ID

Optional

The campaign ID.

Whether the campaign belongs to a campaign container (multipage, multivariate, personnalisation) or not, never use the masterCampaignID for this argument.

Parameter Value Type Default Value Max Length Supported hit types
caid string None None campaign

Example value: "262762"

Example usage: caid="262762"

Variation ID

Optional

The variation ID.

Parameter Value Type Default Value Max Length Supported hit types
vaid string None None campaign

Example value: "873378"

Example usage: vaid="873378"

Use cases

Send a hit from a server to the AB Tasty report

Steps to follow:

Get AB Tasty visitors’ informations

There are two ways to get AB Tasty information. First, check the different AB Tasty variables. Second, give us a pixel to call inside which all the information needed are inserted. The first option is used to test your integration, the second one is used to have a scalable integration with a third-party tool.

All information detailed below concern the first option:

Send the hits

Code implementation with a POST request:

{
	"c":{"342395": "0","339303": "0"},
	"cid":"60511af14f5e48764b83d36ddb8ece5a",
	"dl":"http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
	"sn":1,
	"ec":"Action Tracking",
	"ea":"Hit sent from a server via a POST request",
  "ev":10,
	"t":"EVENT",
	"vid":"18112015371711685"
}
curl -X POST \
  https://ariane.abtasty.com \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
	"c":{"342395": "0","339303": "0"},
	"cid":"60511af14f5e48764b83d36ddb8ece5a",
	"dl":"http%3A%2F%2Fabtastylab.com%2F60511af14f5e48764b83d36ddb8ece5a%2F",
	"sn":1,
	"ec":"Action Tracking",
	"ea":"Hit sent from a server via a POST request",
    "ev":10,
	"t":"EVENT",
	"vid":"18112015371711685"
}' --output ariane_response.tmp

Type of response you will have

// 200 OK
// A binary file ariane_response.tmp will be generated.

Send an event hit type with a POST request to https://ariane.abtasty.com with the information you obtained and the following parameters:

Parameter Value Type Data Required Max Length Supported hit types Description
c string None None List of campaign the visitor has been affected to
cid string None None AB Tasty js identifier
dl string None None URL of the page
sn int None None Session number of the visitor (e.g. sn = 1, first session of the visitor)
ec string Must be “Action Tracking” None Event Category
ea string None None Event Action
t string Must be “EVENT” None Type of the hit
vid string None None ABTasty visitorID assigned to the visitor
ev int None None Event Value