# Other eCommerce platforms

> This guide provides detailed instructions for integrating any eCommerce platform with AnyTrack to uses full tracking and attribution features.

<Prerequisites
  title="Before you begin"
  items={[
    { label: "You have an AnyTrack account with a Personal or Advance plan", done: true },
    { label: "You have access to your platform back-end and API", done: true },
    { label: "You have access to your website code", done: true },
    { label: "You have a developer available to implement the integration", done: true },
  ]}
/>

This guide shows you how to integrate any eCommerce platform with AnyTrack and use full tracking and attribution features.

> ❗ ****
>
> These guidelines require implementation by a skilled developer with access to your platform's codebase or API. Do not attempt to implement these guidelines without the appropriate knowledge and skillset.
>
> If you don't have access to development resources, or if your developer is not up to the task, [contact us](https://anytrack.io/contact) for a referral to a vetted developer.

***

## Integration Overview

### Key Components

To integrate your eCommerce platform with AnyTrack, you'll need to implement:

**1. AnyTrack Tracking Tag**

The [Tracking Tag](/docs/anytrack-tag) must be installed on all pages of your shop to capture events, collect data, and enable attribution.

**2. Click ID Parameter**

The [`click_id`](/docs/anytrack-click-id) is a unique identifier that AnyTrack auto-generates for every visitor. This enables AnyTrack to:

* Attribute events to specific visitors
* Identify customers across sessions
* Tie [first-party data](/docs/event-attributes) collected through the customer journey
* Connect conversions to marketing channels and campaigns

**3. Customer Data**

Collect and send [customer attributes](/docs/event-attributes#customer-traits-supported-by-AnyTrack) such as:

* Email, name, phone number
* Billing and shipping address
* City, state, country, zipcode

**4. Product Data**

Capture [product attributes](/docs/event-attributes#product-attributes) including:

* Product ID (SKU)
* Product name
* Price and currency
* Quantity
* Brand and category

**5. Purchase Activity**

Track purchase events with complete order details and [transaction data](/docs/event-attributes).

> 📘 **Good to know**
>
> All events sent to AnyTrack (via JS or server-side API) are automatically formatted and standardized according to ad platform, API, and analytics requirements.

***

## Tracking Methods: Client-Side vs Server-Side

AnyTrack supports two complementary tracking methods. Understanding when to use each ensures the highest attribution and data collection quality.

### Client-Side Tracking (JavaScript Tag)

Use the [AnyTrack Tag](/docs/anytrack-tag) to track customer journey events:

> 🚧 **Remember**
>
> The AnyTrack Tracking tag must be in the `<head>` section of the page for Event Snippets to work.

| Event Name         | When to Track                   | Code Example                               |
| :----------------- | :------------------------------ | :----------------------------------------- |
| `ViewContent`      | Customer views a product        | `AnyTrack('trigger', 'ViewContent');`      |
| `AddToCart`        | Customer adds a product to cart | `AnyTrack('trigger', 'AddToCart');`        |
| `InitiateCheckout` | Customer starts checkout        | `AnyTrack('trigger', 'InitiateCheckout');` |
| `Purchase`         | Customer completes purchase     | `AnyTrack('trigger', 'Purchase');`         |

### Server-Side Tracking (Webhooks)

Use [server-side tracking](/docs/server-side-tracking) for events triggered on your back-end:

**When to Use Server-Side:**

* Purchase events from your order processing system
* Customer creation in your platform
* Newsletter subscription confirmations

**How Server-Side Works:**

1. Visitor adds product to cart → AnyTrack Tag triggers event and generates **`click_id`**
2. Your cart stores the **`click_id`** parameter
3. Purchase triggers on your server → Platform calls AnyTrack webhook with purchase data **INCLUDING THE `click_id`**
4. AnyTrack ingests the data and sends conversion to ad platforms

> 🚧 **Critical**
>
> The `click_id` parameter generated during website events must be passed back to AnyTrack in the webhook payload. Without the `click_id`, AnyTrack cannot attribute the conversion to the correct campaign.

Learn more in the [Server-Side Tracking guide](/docs/server-side-tracking).

***

## Implementation Guide

### Step 1: Install AnyTrack Tracking Tag

Install the [AnyTrack Tag](/docs/anytrack-tag) in the `<head>` section of all pages:

```html
<!-- AnyTrack Tracking Code -->
<script>!function(e,t,n,s,a){(a=t.createElement(n)).async=!0,a.src="https://assets.anytrack.io/:PROPERTYID.js",(t=t.getElementsByTagName(n)[0]).parentNode.insertBefore(a,t),e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)}}(window,document,"script","AnyTrack");</script>
<!-- End AnyTrack Tracking Code -->
```

Replace `:PROPERTYID` with your actual Property ID from the [AnyTrack dashboard](https://dashboard.anytrack.io).

***

### Step 2: Track Customer Journey Events

Implement JavaScript event tracking for customer journey milestones.

#### ViewContent Event

Track when customers view product pages:

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

#### AddToCart Event

Track when customers add products to their cart:

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

#### InitiateCheckout Event

Track when customers start the checkout process:

```javascript
AnyTrack('trigger', 'InitiateCheckout', {
  cartId: 'cart_abc123',
  quantity: 3,
  currency: 'USD',
  value: 30.00,
  items: [{
    id: '20291',
    name: 'Sony MDRZX110/BLK',
    price: 10.00,
    brand: 'Sony',
    quantity: 1
  }, {
    id: '20292',
    name: 'Beats Headphones',
    price: 10.00,
    brand: 'Beats',
    quantity: 2
  }]
});
```

#### AddPaymentInfo Event

Track when customers enter payment information:

```javascript
AnyTrack('trigger', 'AddPaymentInfo', {
  customerId: 'cus12389',
  email: 'customer@example.com',
  fullName: 'John Smith',
 	address: 'Via Milano 1',
  city: 'Roma',
  zipcode: '829876',
  country: 'Italy',
  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: 'cart_abc123',
  quantity: 3,
  cartTotal: 30.00,
  currency: 'USD',
  tax: 5.00,
  shipping: 37.00,
  value: 72.00,
  items: [{
    id: '20291',
    name: 'Sony MDRZX110/BLK',
    price: 10.00,
    brand: 'Sony',
    quantity: 1
  }, {
    id: '20292',
    name: 'Beats Headphones',
    price: 10.00,
    brand: 'Beats',
    quantity: 2
  }]
});
```

***

### Step 3: Track Purchase Events (Server-Side)

Purchase events should be sent via [server-side tracking](/docs/server-side-tracking) from your back-end.

#### Create Custom Integration

1. Navigate to [AnyTrack Dashboard](https://dashboard.anytrack.io) → Integrations → Create [Custom Integration](/docs/custom-conversion-source)
2. Enter required fields (you can use placeholder values initially)
3. Save the integration to generate your postback URL
4. Copy the postback URL (format: `https://t1.anytrack.io/:ACCOUNTID/collect/custom-integration`)
5. Remove query parameters from the URL (keep only up to `/custom-integration`)

#### Server-Side Purchase Event

Send purchase data from your server to AnyTrack:

**Method 1: Direct HTTP POST**

Send a POST request to your postback URL with this JSON payload:

```json
{
  "`event_name`": "Purchase",
  "`click_id`": "f8e3bf8dfba8b51ce3340",
  "email": "customer@example.com",
  "fullName": "John Smith",
  "phone": "+1919875666",
  "country": "US",
  "city": "Los Angeles",
  "state": "CA",
  "zipcode": "91908",
  "address": "Sunset Blvd 1",
  "items": [{
    "id": "20291",
    "name": "Sony MDRZX110/BLK",
    "quantity": 1,
    "price": 20.00,
    "brand": "Sony"
  }, {
    "id": "49292",
    "name": "Beats Headphones",
    "quantity": 1,
    "price": 100.00,
    "brand": "Beats"
  }],
  "currency": "USD",
  "value": 120.00,
  "taxPrice": 10.00,
  "shippingPrice": 0.00,
  "transactionId": "order_24356562534585",
  "timestamp": 1689982766
}
```

**Method 2: JavaScript Postback (Client-Side)**

If you need to send purchase data from the browser:

```javascript
<script>
  AnyTrack('postback', 'https://t1.anytrack.io/:ACCOUNTID/collect/custom-integration?`click_id`=--CLICK-ID--', {
    `event_name`: "Purchase",
    cartId: "cart_abc123",
    timestamp: 1689982766,
    customerId: "cus12389",
    email: "customer@example.com",
    fullName: "John Smith",
    `order_id`: "oid1763",
    transactionId: "order_as8d7f8asd7fa8sdf7", // Required for deduplication
    billingAddress: {
      address: "Sunset Blvd 1",
      city: "Los Angeles",
      zipcode: "91908",
      country: "US"
    },
    shippingAddress: {
      address: "Via Milano 1",
      city: "Roma",
      zipcode: "829876",
      country: "Italy"
    },
    quantity: 3,
    cartTotal: 30.00,
    currency: "USD",
    orderTotal: 72.00,
    tax: 5.00,
    shipping: 37.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
    }]
  });
</script>
```

> ❗ ****
>
> * Remove attributes you don't have access to (e.g., if you don't have a `cartId`, remove it from the payload)
> * The snippet will not work unless the AnyTrack tracking tag fires first
> * If using Google Tag Manager, add sequential trigger ordering to ensure AnyTrack tag fires before the postback

***

## Event Attributes Reference

For complete details on all supported parameters, see the [Event Attributes documentation](/docs/event-attributes).

**Key attribute categories:**

* [Customer Data](/docs/event-attributes#customer-traits-supported-by-AnyTrack) - Email, phone, name, location
* [Product Data](/docs/event-attributes#product-attributes) - SKU, price, quantity, brand
* [Event Data](/docs/event-attributes) - Transaction ID, timestamp, currency

***

## Verification

After implementing tracking, verify your integration is working:

### 1. Check Event Log

Go to [AnyTrack Dashboard](https://dashboard.anytrack.io) → Integrations → Your Custom Integration → [Event Log](/docs/integration-event-log)

You should see events flowing in real-time with all [event parameters](/docs/event-attributes).

### 2. Test Purchase Flow

1. Complete a test purchase on your site
2. Check the [Event Log](/docs/integration-event-log) for the Purchase event
3. Verify all parameters are present (email, `revenue`, products, `click_id`)
4. Confirm event appears in [Conversions Report](/docs/conversions-report)

### 3. Verify Ad Platform Sync

1. Wait 15-20 minutes after test purchase
2. Check [Facebook Events Manager](/docs/facebook-ads) or [Google Ads](/docs/google-ads) for the conversion
3. Verify [Event Match Quality](/docs/facebook-event-match-quality) shows high match rate

***

## Alternative Integration Methods

### Using Google Tag Manager

If you've already mapped eCommerce `dataLayer` through [Google Tag Manager](/docs/install-anytrack-tag-with-google-tag-manager), you can use these variables with AnyTrack event snippets:

**Supported Platforms:**

* Shopware
* BigCommerce
* CommerceOne
* Adobe Commerce (Magento)
* Other platforms with GTM dataLayer

[Google Tag Manager Setup Guide →](/docs/install-anytrack-tag-with-google-tag-manager)

### Using Zapier Webhooks

For simpler webhook setup without custom development:

1. Create a Zap with your eCommerce platform as the trigger
2. Use **Webhooks by Zapier** as the action
3. Set webhook URL: `https://t1.anytrack.io/:ACCOUNTID/collect/custom-integration`
4. Map form fields to [AnyTrack event parameters](/docs/event-attributes)

***

## Common Questions

<FaqAccordion
  title="Common Questions"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Can I use Google Tag Manager to trigger AnyTrack Event Snippets?",
      answer: "Yes. If you have already mapped the eCommerce dataLayer through Google Tag Manager, you can use those variables with the AnyTrack event snippets. This works with Shopware, BigCommerce, Adobe Commerce (Magento), and other platforms that support GTM dataLayer."
    },
    {
      question: "What are all the supported parameters I can pass to AnyTrack?",
      answer: "You can find all supported parameters in the Event Attributes documentation. This includes customer data (email, phone, name, location), product data (SKU, price, quantity, brand), and event metadata. All parameters are optional except <code>click_id</code> which is required for attribution."
    },
    {
      question: "How do I verify that my integration is properly implemented?",
      answer: "Check the Integration Event Log in your AnyTrack dashboard. You should see all event parameters appear in real time after triggering an event such as completing a test purchase. Verify that customer data, product details, and the <code>click_id</code> are present."
    },
    {
      question: "How does AnyTrack prevent duplicate conversions?",
      answer: "Use the transactionId parameter with a unique order ID for each purchase. AnyTrack automatically deduplicates conversions with matching transaction IDs. See the Event Attributes guide for implementation details."
    },
    {
      question: "Should I disconnect my direct Facebook pixel integration?",
      answer: "Yes. Once you have integrated AnyTrack, disconnect any other direct ad integrations to avoid sending duplicate data to your ad platforms. AnyTrack handles all tag delivery and server-side event sync automatically."
    },
    {
      question: "Can I connect an ad platform that is not integrated with AnyTrack?",
      answer: "Yes. Follow the guidelines in the Other Ad Platforms documentation to connect ad platforms that do not have pre-built integrations."
    },
    {
      question: "What if I cannot access the <code>click_id</code> from my checkout page?",
      answer: "The <code>click_id</code> can be passed through your checkout flow in several ways: URL parameter, hidden form field, session storage, or cookie. The AnyTrack tag automatically generates and stores the <code>click_id</code>. See the Click ID guide for implementation methods."
    }
  ]}
/>

***

## Next Steps

**Connect Ad Platforms:**
Send conversions to your advertising accounts:

* [Facebook Ads (Conversion API)](/docs/facebook-ads)
* [Google Ads (Enhanced Conversions)](/docs/google-ads)
* [TikTok Ads (Events API)](/docs/tiktok-ads)
* [Microsoft Ads](/docs/microsoft-ads)

**Advanced Tracking:**

* [Event Mapping](/docs/event-mapping) - Customize event names per platform
* [Server-Side Tracking](/docs/server-side-tracking) - Send events from your back-end
* [Event Attributes](/docs/event-attributes) - Complete parameter reference

**Need Help?**

* [Troubleshooting Guide](/docs/troubleshooting-integrations)
* [Server-Side Tracking](/docs/server-side-tracking)
* [Contact Support](https://anytrack.io/contact)
