Other eCommerce platforms

This guide provides detailed instructions for integrating any eCommerce platform with AnyTrack to utilize comprehensive tracking and attribution features. It emphasizes the need for a skilled developer to implement the integration, highlighting the use of AnyTrack's JavaScript tag and server-side tracking to capture customer data, journey, and purchase activities. The guide also outlines the necessary components and events to track, ensuring high-quality data collection and marketing channel attribution.

In this guide, you will learn how to integrate any ecommerce platform with AnyTrack and leverage every possible tracking and attribution feature available to integrated partners.

❗️

Warning

These guidelines are provided "as is", and such implementation can only be performed by a skilled developer with access to your platform's codebase or API. Do not attempt to implement these guidelines if you don't have the appropriate knowledge and skillset.

📘

Good to know

If you don't have access to development resources, or if your developer is not up to the task, don't hesitate to get in touch with us, and we will refer you to a vetted developer.

🚧

To get started you will need the following:

  • An AnyTrack account with a Personal or Advanced plan.
  • Access to your platform back-end and and API
  • Access to your website code.
  • Recommended: Google Tag Manager

Integration Key Components

The key components of integrating this type of eCommerce solutions are:

  • The AnyTrack Tracking Tag: The Tracking Tag must be set on all pages of your shop in order to instrument events, data collection and attribution.
  • The click_id parameter  - The click_id value that AnyTrack auto-generates for every event triggered via the JS tag enables AnyTrack to attribute the events to your website's visitors, identify them and tie first-party data collected through the customer journey with marketing channels, campaigns, and other traffic-related parameters.
  • Customer data - Tracking information such as name, email, phone number, or other customer attributes
  • Customer journey  - Tracking customer journey activity, what products they viewed, add to cart events.
  • Purchase activity - Tracking purchases and their attributes (product names, SKU, currencies, etc...)

👍

Good to know:

As long as events are sent to AnyTrack (via JS or server-side API), they will be automatically formatted and standardized according to the ad pixels, APIs, and analytics requirements.

About Client side and Server-Side Tracking

This guide focuses on how to track important customer activities in AnyTrack. While certain events can be sent interchangeably via JS tag or server-side API, we highly recommend you follow the below guidelines to guarantee the highest attribution and data collection quality.

Use our JavaScript Tag to track the following events:

🚧

Remember

The AnyTrack Tracking tag must be in the head section of the page for the Event Snippets to work.

Event NameInfoCode
ViewContentWhen a user views a productAnyTrack('trigger', 'ViewContent');
AddToCartWhen a user adds a product to their cartAnyTrack('trigger', 'AddToCart');
InitiateCheckoutWhen a user starts the checkoutAnyTrack('trigger', 'InnitiateCheckout');
PurchaseWhen a user completes a purchaseAnyTrack('trigger', 'Purchase');

Use the server-side tracking for the following events:

Server-side events are sent through webhooks. They require that the click_id value generated during the website events is sent back to AnyTrack in the JSON (or query parameters payload).

You should read this guide if you're unfamiliar with server-side tracking requirements.

How it works:

  1. When a visitor adds a product to the cart, the AnyTrack Tag triggers an event and sends a unique click_id to the cart.
  2. When the purchase is triggered, your platform calls the Anytrack webhook URL and passes the purchase data, INCLUDING THE CLICK_ID PARAMETER FROM THE CART.
  3. AnyTrack ingests the data and sends the conversion data back to the ad platforms.

What are the events you should send via Server Side Tracking

  • Purchase: Events coming from your back-end server.
  • Customer creation: When a customer is created in your platform
  • Lead creation: When a user confirms their newsletter subscription

The attributes you send to AnyTrack alongside each type of event will enable you to improve your marketing channel attribution, the data quality used to enrich your audience data, and overall improve your data-driven marketing.

🚧

Caution:

Note that the snippets in this guide use example data. You will need to update the values with the actual event values.

JavaScript Tag for website engagements

Use the Javascript Tags to programmatically trigger events on your website and send granular data to AnyTrack.

Note that any of the snippets provided below can only work as long as the main AnyTrack Tag is in the head section of your site.

View Product Event

When a visitor is viewing a specific product.

AnyTrack('trigger', 'ViewContent',
{
 items: [
  {
   id: '20291',
   name: 'Sony MDRZX110/BLK ZX Series Stereo Headphones',
   price: 19.9,
   currency: 'USD',
   brand: 'Sony',
   quantity: 1
}
]
});
AnyTrack('trigger', 'ViewContent',
{
 items: [
  {
   id: '20291',
   name: 'Sony MDRZX110/BLK ZX Series Stereo Headphones',
   price: 19.9,
   currency: 'USD',
   brand: 'Sony',
   quantity: 1
}
]
});

Add To Cart Event

AnyTrack('trigger', 'AddToCart',
{
 items: [
  {
   id: '20291',
   name: 'Sony MDRZX110/BLK ZX Series Stereo Headphones',
   price: 19.9,
   currency: 'USD',
   brand: 'Sony',
   quantity: 1
}
]
});

Initiate Checkout Event

AnyTrack('trigger', 'InitiateCheckout', {
  cartId: 'adsfasdf',
  quantity: 3,
  cartSubTotal: 30.00,
  currency: 'USD',
  orderTotal: 30.00, 
  items: [{
   	item_id: '20291',
    item_name: 'Sony MDRZX110/BLK',
    price: 10.00,
    currency: 'USD',
    brand: 'Sony',
    quantity: 1
    },
    {
    item_id: '20292',
    item_name: 'Beats Headphones',
    price: 10.00,
    currency: 'USD',
    brand: 'Beats',
    quantity: 2
    }]
});

Add Payment Info

AnyTrack('trigger', 'AddPaymentInfo',
{
 customerId: 'cus12389',
 email: '[email protected]',
 fullName: 'Elon Musk',
  paymentMethod:
  {
    type: 'card',
    gateway: 'stripe',
    provider: 'visa',
    digits: '1984',
    expiry: '01/24',
    zipcode: '91908'
  },
 billingAddress:
 {
  address: 'Sunset Blvd 1',
  city: 'Los Angeles',
  zipcode: '91908',
  country: 'US'
 },
 shippingAddress:
 {
  address: 'Via Milano 1',
  city: 'Roma',
  zipcode: '829876',
  country: 'Italy'
 },
 cartId: 'adsfasdf',
 quantity: 3,
 cartTotal: 30.00,
 currency: 'USD',
 tax: 5.00,
 shipping: 37.00,
 orderTotal: 72.00,
 items: [
  {
   id: '20291',
   name: 'Sony MDRZX110/BLK',
   price: 10.00,
   currency: 'USD',
   brand: 'Sony',
   quantity: 1
},
  {
   id: '20292',
   name: 'Beats Headphones',
   price: 10.00,
   currency: 'USD',
   brand: 'Beats',
   quantity: 2
}]
});

Purchase Event

This event Should be sent via Server Side / webhook.

📘

Zapier webhook

It might be easier to go through Zapier to get the event and format it according to the AnyTrack parameters.

//the acountid and integrationid will be set when you 
//create a custom integration in your anytrack account
https://t1.anytrack.io/collect/:accountid/:integrationId

Please refer to the event attributes article to leverage all data points available in AnyTrack.

{
  "event_name": "Purchase",
  "clickId": "f8e3bf8dfba8b51ce3340",
  "refId": 'adsfasdf',
  "cartId": 'adsfasdf',
  "timestamp": 1689982766,
  "customerId": "cus12389",
  "email": "[email protected]",
  "fullName": "Elon Musk",
  "order_id": "oid1763",
  "transaction_id": "as8d7f8asd7fa8sdf7", //required for deduplication
  "paymentMethod": {
    "type": "card",
    "gateway": "stripe",
    "provider": "visa",
    "digits": "1984",
    "expiry": "01/24",
    "zipcode": "91908"
  },
  "billingAddress": {
    "address": "Sunset Blvd 1",
    "city": "Los Angeles",
    "zipcode": "91908",
    "country": "US"
  },
  "shippingAddress": {
    "address": "Via Milano 1",
    "city": "Roma",
    "zipcode": "829876",
    "country": "Italy"
  },
  "cartId": "adsfasdf",
  "quantity": 3,
  "cartTotal": 30,
  "currency": "USD",
  "orderTotal": 72,
  "tax": 5,
  "shipping": 37,
  "items": [
    {
      "id": "20291",
      "name": "Sony MDRZX110/BLK",
      "price": 10,
      "currency": "USD",
      "brand": "Sony",
      "quantity": 1
    },
    {
      "id": "20292",
      "name": "Beats Headphones",
      "price": 10,
      "currency": "USD",
      "brand": "Beats",
      "quantity": 2
    }
  ]
}

FAQ & Troubleshooting

  • Can I use Google Tag Manager to trigger the AnyTrack Event Snippets?

    Absolutely! if you've already mapped the ecommerce dataLayer through Google Tag Manager you can use these variables with the AnyTrack event snippets.
  • Which eCommerce platforms can be integrated with Google Tag Manager?

    Shopware, BigCommerce, CommerceOne, Adobe Commerce (formerly Magento) and plenty of other popular platforms.
  • What are the supported parameters that I can pass to the AnyTrack event snippets or webhook?

    You can find all parameters in the Event Attributes article.
  • How do I verify that my integration is properly implemented?

    You should see all event parameters in the integration event log.
  • How does anytrack prevents duplicate conversions?

    Using the transaction_id parameter you can deduplicate conversions sent to AnyTrack.
  • Shall I disconnect my direct Facebook pixel Integration

    Yes. Once you've integrated Anytrack you can disconnect any other direct ads integrations in order to avoid sending duplicate data to your ad platforms.
  • Can I connect an ad platform that is not integrated with Anytrack?

    Yes. Please follow these guidelines.