Track Transaction

This method is used to send data for a transaction that takes place.

To track a transaction (order), send a single transaction event, and one event for each line item (of the order).

Track Transaction Syntax:

_itq.push(["_addTrans", "<transaction ID>", "<Affiliate or Store Name>", "<total>", "<tax>", "<shipping>", "<shipping city>", "<shipping region>", "<shipping country>",
  <extended data>
]);
  • transaction ID (required)
    • Your unique reference for the transaction or order (a string).
  • affiliate or store name (required)
    • A string to indicate affiliate or store name, can be an empty string "".
  • total (required)
    • The total value of the transaction, a number only, no currency. Normally including tax, but your choice, just be consistent, document your decision.
  • tax (required)
    • The value of the tax applied to the transaction, a number, no currency.
  • shipping (required)
    • The amount of shipping applied to the transaction, no currency. Usually included in the total, but your choice, just be consistent, document your decision.
  • shipping city (required)
    • A string indicating the shipping city.
  • shipping region (required)
    • A string indicating the shipping region.
  • shipping country (required)
    • A string indicating the shipping country.
  • extended data
  • [
        { "name" : "Transaction.Currency", "value" : "GBP" },
        { "name" : "Transaction.Payment Method", "value" : "Card" }
    ]	

Everywhere where Currency is used please follow ISO-4217 standard.

Track addItem Syntax:

_itq.push(["_addItem", "<transaction ID>", "<SKU>", "<item name>", "<category or variation>", <unit price>, <quantity>, <extended data>]);
  • transaction ID (required)
    • Your unique reference for the transaction or order (a string).
  • SKU (required)
    • Your unique product ID, passed as a string.
  • item name (required)
    • Item name as a string.
  • category or variation (required)
    • A category the item is in, or use it to indicate a variation.
  • unit price (required)
    • The unit price as a number (or the total price for the line, your choice, just be consistent, document your decision, and let us know)
  • quantity (required)
    • Number of items in the line
  • extended data
[
    { "name" : "Purchased Item.Product Tax", "value" : "USD999.55" },
    { "name" : "Purchased Item.Shipping Method", "value" : "FedEx" },
    { "name" : "Purchased Item.Shipping Cost", "value" : "USD999.55" }
]

Everywhere where Currency is used please follow ISO-4217 standard.

Complete Example

Tracking a transaction with 2 line items

_itq.push(['_addTrans',
    '1234-2342-ABCD-2AB9',
    'Mervel',
    '250',
    '0',
    '15',
    'Chester',
    'Cheshire',
    'UK',
    [
        { "name" : "Transaction.Currency", "value" : "GBP" },
        { "name" : "Transaction.Payment Method", "value" : "Card" }
    ]
]);

_itq.push(['_addItem',
    '1234-2342-ABCD-2AB9',
    'DD44',
    'T-Shirt',
    'Olive Medium',
    '120',
    '1',
    [
        { "name" : "Purchased Item.Product Tax", "value" : "USD999.55" },
        { "name" : "Purchased Item.Shipping Method", "value" : "FedEx" },
        { "name" : "Purchased Item.Shipping Cost", "value" : "USD999.55" }
    ]
]);

_itq.push(['_addItem',
    '1234-2342-ABCD-2AB6',
    'DD43',
    'T-Shirt',
    'Olive Large',
    '120',
    '1',
    [
        { "name" : "Purchased Item.Product Tax", "value" : "USD999.55" },
        { "name" : "Purchased Item.Shipping Method", "value" : "FedEx" },
        { "name" : "Purchased Item.Shipping Cost", "value" : "USD999.55" }
    ]
]);

Still need help? Contact Us Contact Us