Shopify

Easily integrate AnyTrack with Shopify and get full visibility into your eCommerce performance. Maximize ROAS and gain valuable insights into your marketing campaigns.

Shopify Integration Overview

Shopify and AnyTrack make it easy for businesses to track their online conversions. With Shopify, customers can easily create an e-commerce store with a wide range of features and products. By integrating AnyTrack into the Shopify platform, users are able to capture conversion data from purchases made through their website or mobile app. This information is then sent directly to AnyTrack where it's securely stored before being forwarded on to platforms like Google Ads, Facebook Conversion API and Tiktok API so that companies can measure performance more accurately across multiple channels. Ultimately this integration allows business owners greater insights into how they're performing so they can better serve their customers in the future!

✍️

This article was first published on 2023-04-19 and was last updated on 2023-07-16. If you you notice something that is outdated, please suggest an edit.

How does the Shopify AnyTrack integration work:

  1. Traffic: When visitors land on your website, AnyTrack collects traffic source data and First Party data.
  2. Customer Journey Tracking: During the customer journey, AnyTrack automatically tracks events such as ViewContent, AddToCart, and InitiateCheckout through the AnyTrack Tracking Tag.
    1. Collects and sends product data such as sku, price, quantity and name.
    2. Sends hidden tracking parameter to the cart object.
    3. Triggers the corresponding events such as AddToCart to the AnyTrack API which is instantly forwarded to your Ad Platform's Conversion API.
  3. Shopify Webhooks: AnyTrack also receives via Shopify Webhook notifications customer journey events and sends them to the Ad Platforms' conversion API.
  4. Conversions: When customer complete their purchase anytrack the conversion data (including customer data and product data)
  5. Attribution: AnyTrack processes the conversion data and reports it across various reporting sections of the Anytrack Dashboard.
  6. Conversion API: AnyTrack then sends your conversions to your Ad Platforms' Conversion API so you can feed your ad platform's Machine Learning, AI and automatic optimization according to 100% of your conversion data.

Technical details

ReferenceValueInformation
Tracking GroupshopifyThe Tracking Group reference can be used to activate AutoTag.
Subid ParameteratclidThe Subid Parameter used to pass the AnyTrack click_id.
Tracking MethodWebhook-

Standard Conversions

This table shows the event mapping between shopify, AnyTrack, Facebook and Google Analytics GA4.

πŸ‘

Good to know:

Each ad platforms integration has its own Event Mapping which AnyTrack handles automatically for you.

ShopifyAnyTrackFacebookGA4Details
item_viewViewContentViewContentview_itemWhen a visitor views a product.
cart/createAddToCartAddToCartadd_to_cartWhen a visitor adds a product to its cart.
-Lead--
checkout/createInitiateCheckoutInitiateCheckoutbegin_checkout
checkout/updateAddPaymentInfoAddPaymentInfoadd_payment_info
orders/createPurchasePurchasepurchase

The Shopify Webhook

The Webhook is pre-defined and ready to be implemented with your Shopify account.

https://t1.anytrack.io/hBtoE3hN/collect/shopify

❗️

Before you begin

The Shopify integration requires that the AnyTrack Tracking Tag in the head section of your website or landing pages. Learn now to Install the AnyTrack Tag on your shop.

Setup Guide

Step #1: Add The AnyTrack Tag to your Shop

  1. Create a new property
  2. Set the Shop Name and URL (the root domain) and click Next.
  3. Copy the Anytrack Tracking Tag.
  4. Open the Shopify Admin and Edit the Theme Code
  5. Select the Theme Liquid File and Paste the Tracking Tag in the head section.
  6. Safe the Theme Liquid file.
  7. Visit your Shop to validate the integration (Refresh the page to validate).
  8. Return to AnyTrack and adjust the property settings
    1. Time Zone: Make sure it matches your shop time zone in order to avoid unnecessary discrepancies.
    2. The Base Currency: Set the currency you want the dashboard to reflect. AnyTrack will convert any revenues into your base currency.
    3. Client Side Tracking Settings: We recommend leaving the default settings which have proven to be very efficient.

Step #2: Add Shopify to your AnyTrack Account

  1. Go to the Integration Catalog, search for Shopify.
Integration Catalog
  1. Now click on the Shopify card and then Click on Install Integration.
Shopify Integration Page

Step #3: Connect your Shopify Customer Events

  1. Copy the Webhook URL
  2. Go to your Shopify Admin Panel
  3. Navigate to Settings >> Notification
  4. Scroll down to the Webhooks section and click on "Create webhook"
    1. Select the event you want to track
    2. Leave the format as JSON
    3. Paste the Webhook
    4. Update the Webhook version to Latest
    5. Click on "Save webhook"

πŸ‘

Repeat these steps for all events listed on the Integration page.

Step #4: Adjust the Conversion Event Mapping

The Event Mapping allows you to define which events to track and map to Conversion Events you will Send to your Ads Integrations (ex: Facebook Conversion API)

Shopify Conversion Event Mapping

Step #5: Connect AnyTrack with Facebook Ads

Now that your shop is connected with AnyTrack, your customer journeys are tracked but they are not yet sent by AnyTrack to your Ad Platform's Conversion API such as Facebook, TikTok or Google Ads.

πŸ‘

Good to know:

The integration is done via the AnyTrack Dashboard and does not require any setup on the Shopify Admin.

  1. Navigate to the Tracking Pixels
  2. Click on the Facebook Pixel Card
  3. Click on the button Browse to connect to your Facebook Business Manager.
  4. Select the Facebook Pixel and Facebook Manager
  5. Click Next
  6. Now click on Connect to open a connection with your Ad Account
  7. Enable the Facebook Conversion API
  8. Scroll down and Save.
  9. Now Open the Ads Integration Tab (scroll up to the top of the screen)
  10. Click on the UTM Tracking Template
  11. Add the Template to your Facebook Ads

πŸ‘

Connect other ad accounts

Repeat this process to connect other ad accounts.

❗️

Reminder

You must disconnect any other direct integrations that currently send conversions to your ad platforms or you will inevitably generate duplicate data in your ad accounts.

Validate your integration

This section will enable you to validate the main aspects of your setup.

Conversion Tracking

To validate your setup, you should either wait for a conversion or trigger a test conversion yourself and inspect the conversion logs.

Integration Conversion log

Shopify conversion payload example


{
  "cancelled_at": null,
  "fulfillment_status": null,
  "original_total_additional_fees_set": null,
  "current_total_discounts_set": {
    "shop_money": {
      "amount": "0.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "0.00",
      "currency_code": "USD"
    }
  },
  "billing_address": {
    "zip": "10007",
    "country": "United States",
    "city": "new york",
    "address2": null,
    "address1": "asdf 1",
    "latitude": null,
    "last_name": "mouse",
    "province_code": "NY",
    "country_code": "US",
    "province": "New York",
    "phone": null,
    "name": "adf mouse",
    "company": null,
    "first_name": "adf",
    "longitude": null
  },
  "line_items": [
    {
      "variant_title": "carbon",
      "fulfillment_status": null,
      "total_discount": "0.00",
      "gift_card": false,
      "requires_shipping": true,
      "total_discount_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "USD"
        }
      },
      "title": "anytrack basic plan",
      "product_exists": true,
      "variant_id": 44817526358303,
      "tax_lines": [
        {
          "channel_liable": false,
          "price_set": {
            "shop_money": {
              "amount": "0.00",
              "currency_code": "USD"
            },
            "presentment_money": {
              "amount": "0.00",
              "currency_code": "USD"
            }
          },
          "title": "New York State Tax",
          "rate": 0,
          "price": "0.00"
        }
      ],
      "price": "10.00",
      "vendor": "anytrack analytics",
      "product_id": 7982810628383,
      "id": 13906281857311,
      "grams": 300,
      "sku": "anytrack123",
      "fulfillable_quantity": 1,
      "quantity": 1,
      "fulfillment_service": "manual",
      "taxable": true,
      "variant_inventory_management": "shopify",
      "discount_allocations": [],
      "admin_graphql_api_id": "gid://shopify/LineItem/13906281857311",
      "name": "anytrack basic plan - carbon",
      "price_set": {
        "shop_money": {
          "amount": "10.00",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "10.00",
          "currency_code": "USD"
        }
      },
      "properties": [
        {
          "name": "_atclid",
          "value": "Q6Pr5uPG5w3uHpsft9m2iHwAjMkfi4aAvd"
        }
      ],
      "duties": []
    },
    {
      "variant_title": "carbon",
      "fulfillment_status": null,
      "total_discount": "0.00",
      "gift_card": false,
      "requires_shipping": true,
      "total_discount_set": {
        "shop_money": {
          "amount": "0.00",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "0.00",
          "currency_code": "USD"
        }
      },
      "title": "anytrack basic plan",
      "product_exists": true,
      "variant_id": 44817526358303,
      "tax_lines": [
        {
          "channel_liable": false,
          "price_set": {
            "shop_money": {
              "amount": "0.00",
              "currency_code": "USD"
            },
            "presentment_money": {
              "amount": "0.00",
              "currency_code": "USD"
            }
          },
          "title": "New York State Tax",
          "rate": 0,
          "price": "0.00"
        }
      ],
      "price": "10.00",
      "vendor": "anytrack analytics",
      "product_id": 7982810628383,
      "id": 13906281890079,
      "grams": 300,
      "sku": "anytrack123",
      "fulfillable_quantity": 1,
      "quantity": 1,
      "fulfillment_service": "manual",
      "taxable": true,
      "variant_inventory_management": "shopify",
      "discount_allocations": [],
      "admin_graphql_api_id": "gid://shopify/LineItem/13906281890079",
      "name": "anytrack basic plan - carbon",
      "price_set": {
        "shop_money": {
          "amount": "10.00",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "10.00",
          "currency_code": "USD"
        }
      },
      "properties": [
        {
          "name": "_atclid",
          "value": "Q6Pr5uPG5w3uHpsft9m2iHwAjMkfi3pm6l"
        }
      ],
      "duties": []
    }
  ],
  "original_total_duties_set": null,
  "presentment_currency": "USD",
  "total_discounts_set": {
    "shop_money": {
      "amount": "0.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "0.00",
      "currency_code": "USD"
    }
  },
  "location_id": null,
  "source_url": null,
  "landing_site": "/password",
  "source_identifier": "d92ccf6a26eb55f8f4ea63d30a8e6fe4",
  "reference": "d92ccf6a26eb55f8f4ea63d30a8e6fe4",
  "number": 40,
  "checkout_id": 36717670301983,
  "checkout_token": "fa7d7c8bb2306071de2d32f0dfafa1a3",
  "tax_lines": [],
  "current_total_discounts": "0.00",
  "merchant_of_record_app_id": null,
  "customer_locale": "en-US",
  "current_total_additional_fees_set": null,
  "id": 5355587109151,
  "app_id": 580111,
  "subtotal_price": "20.00",
  "closed_at": null,
  "order_status_url": "https://shopify.anytrack.dev/67299934495/orders/48e04fede91eb931473d0252689284ae/authenticate?key=0d03f7cddcacc8576ba375c3eb197a14",
  "current_total_price_set": {
    "shop_money": {
      "amount": "24.90",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "24.90",
      "currency_code": "USD"
    }
  },
  "device_id": null,
  "test": true,
  "total_shipping_price_set": {
    "shop_money": {
      "amount": "4.90",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "4.90",
      "currency_code": "USD"
    }
  },
  "subtotal_price_set": {
    "shop_money": {
      "amount": "20.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "20.00",
      "currency_code": "USD"
    }
  },
  "payment_gateway_names": [
    "bogus"
  ],
  "total_tax": "0.00",
  "tags": null,
  "current_subtotal_price_set": {
    "shop_money": {
      "amount": "20.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "20.00",
      "currency_code": "USD"
    }
  },
  "current_total_tax": "0.00",
  "shipping_lines": [
    {
      "code": "Economy",
      "delivery_category": null,
      "source": "shopify",
      "title": "Economy",
      "discount_allocations": [],
      "carrier_identifier": "650f1a14fa979ec5c74d063e968411d4",
      "discounted_price_set": {
        "shop_money": {
          "amount": "4.90",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "4.90",
          "currency_code": "USD"
        }
      },
      "discounted_price": "4.90",
      "tax_lines": [
        {
          "channel_liable": false,
          "price_set": {
            "shop_money": {
              "amount": "0.00",
              "currency_code": "USD"
            },
            "presentment_money": {
              "amount": "0.00",
              "currency_code": "USD"
            }
          },
          "title": "New York State Tax",
          "rate": 0,
          "price": "0.00"
        }
      ],
      "phone": null,
      "price": "4.90",
      "id": 4381009805599,
      "price_set": {
        "shop_money": {
          "amount": "4.90",
          "currency_code": "USD"
        },
        "presentment_money": {
          "amount": "4.90",
          "currency_code": "USD"
        }
      },
      "requested_fulfillment_service_id": null
    }
  ],
  "phone": null,
  "user_id": null,
  "note_attributes": [
    {
      "name": "__atclid",
      "value": "Q6Pr5uPG5w3uHpsft9m2iHwAjMkfi4aAvd"
    }
  ],
  "name": "#1040",
  "cart_token": "b586654b9cd59c51d2902b1fdb47c9a7",
  "total_tax_set": {
    "shop_money": {
      "amount": "0.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "0.00",
      "currency_code": "USD"
    }
  },
  "landing_site_ref": null,
  "discount_codes": [],
  "estimated_taxes": false,
  "note": null,
  "current_subtotal_price": "20.00",
  "current_total_tax_set": {
    "shop_money": {
      "amount": "0.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "0.00",
      "currency_code": "USD"
    }
  },
  "total_outstanding": "0.00",
  "order_number": 1040,
  "discount_applications": [],
  "created_at": "2023-05-25T17:09:58+03:00",
  "total_line_items_price_set": {
    "shop_money": {
      "amount": "20.00",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "20.00",
      "currency_code": "USD"
    }
  },
  "taxes_included": false,
  "buyer_accepts_marketing": false,
  "payment_terms": null,
  "confirmed": true,
  "total_weight": 600,
  "contact_email": "[email protected]",
  "refunds": [],
  "total_discounts": "0.00",
  "fulfillments": [],
  "client_details": {
    "accept_language": "en-US",
    "browser_width": null,
    "browser_height": null,
    "session_hash": null,
    "browser_ip": "2.54.33.20",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
  },
  "referring_site": null,
  "updated_at": "2023-05-25T17:09:59+03:00",
  "processed_at": "2023-05-25T17:09:56+03:00",
  "company": null,
  "currency": "USD",
  "shipping_address": {
    "zip": "10007",
    "country": "United States",
    "city": "new york",
    "address2": null,
    "address1": "asdf 1",
    "latitude": null,
    "last_name": "mouse",
    "province_code": "NY",
    "country_code": "US",
    "province": "New York",
    "phone": null,
    "name": "adf mouse",
    "company": null,
    "first_name": "adf",
    "longitude": null
  },
  "browser_ip": "2.54.33.20",
  "email": "[email protected]",
  "source_name": "web",
  "total_price_set": {
    "shop_money": {
      "amount": "24.90",
      "currency_code": "USD"
    },
    "presentment_money": {
      "amount": "24.90",
      "currency_code": "USD"
    }
  },
  "current_total_duties_set": null,
  "total_price": "24.90",
  "total_line_items_price": "20.00",
  "total_tip_received": "0.00",
  "token": "48e04fede91eb931473d0252689284ae",
  "cancel_reason": null,
  "current_total_price": "24.90",
  "admin_graphql_api_id": "gid://shopify/Order/5355587109151",
  "financial_status": "paid",
  "customer": {
    "note": null,
    "tax_exempt": false,
    "email_marketing_consent": {
      "consent_updated_at": null,
      "opt_in_level": "single_opt_in",
      "state": "not_subscribed"
    },
    "created_at": "2023-05-25T17:09:56+03:00",
    "last_name": "mouse",
    "multipass_identifier": null,
    "verified_email": true,
    "tags": null,
    "accepts_marketing_updated_at": "2023-05-25T17:09:56+03:00",
    "sms_marketing_consent": null,
    "default_address": {
      "zip": "10007",
      "country": "United States",
      "address2": null,
      "city": "new york",
      "address1": "asdf 1",
      "last_name": "mouse",
      "province_code": "NY",
      "country_code": "US",
      "default": true,
      "province": "New York",
      "phone": null,
      "name": "adf mouse",
      "country_name": "United States",
      "company": null,
      "id": 9207663264031,
      "customer_id": 6954102685983,
      "first_name": "adf"
    },
    "updated_at": "2023-05-25T17:09:58+03:00",
    "accepts_marketing": false,
    "phone": null,
    "admin_graphql_api_id": "gid://shopify/Customer/6954102685983",
    "tax_exemptions": [],
    "currency": "USD",
    "id": 6954102685983,
    "state": "disabled",
    "marketing_opt_in_level": null,
    "first_name": "adf",
    "email": "[email protected]"
  },
  "x-shopify-shop-domain": "anytrackio.myshopify.com",
  "x-shopify-order-id": "5355587109151",
  "x-shopify-webhook-id": "04d63e6e-b396-4042-9103-6ddce6843c34",
  "x-shopify-hmac-sha256": "gwTsn9doiHm1nReF5KLU9DMKWRBDu+spclTdUkTNGmU=",
  "x-shopify-test": "true",
  "x-shopify-topic": "orders/create",
  "x-shopify-triggered-at": "2023-05-25T14:09:59.524353187Z",
  "x-shopify-api-version": "2023-04"
}

FAQ & Troubleshooting

  • Can I import past conversions into Anytrack?

    No. Anytrack can only ingest conversions that have been triggered following a visitor session on your website.
  • How do I prevent the AnyTrack Click id from displaying in the Cart line items?

    Per Shopify's documentation, any line item property value beginning with an underscore (e.g., _hiddenPropertyName) should be hidden from customers at checkout. If your theme does not follow this best practice, it will result in the _atclid being shown during the checkout. Follow these instructions to adjust your code .
  "properties": [
        {
          "name": "_atclid",
          "value": "Q6Pr5uPG5w3uHpsft9m2iHwAjMkfi3pm6l"
  • The Conversion Name is not what I am expecting, how do I change it?

    🚧

    Warning:

    Update the mapping ONLY if you know what you're doing and what you're expecting on your ad platform's event manager.
    You can update the Event Mapping in the Integration page, but it's not recommended as the standard events configured in the integration are mapped to standard events in your Ad Platforms.

Shopify Event Mapping

Take these steps to troubleshoot errors you encounter in AnyTrack

πŸ‘

Default settings = Success

Based on thousands of integrations with Shopify, if you've followed the instructions and applied the default integration settings, you should not experience any issues.

  • General troubleshooting

    • Check that the AnyTrack tag is in the head section of your shop.
    • If you're on the free plan, check the monthly traffic limit in the billing section.
    • The free plan does not include Conversion API for any Ad platforms.
    • You've followed the default settings.
  • What are the Errors displayed in the Integration logs?

    Tracking errors can happen if the visitor blocks javascripts on his browser, or is preventing tracking pixels to load.
  • Why are there discrepancies between Shopify and AnyTrack?

    You will have different metrics between Shopify Analytics and AnyTrack. It's an inherent part of the analytics industry. While it seems simple, all analytics are affected by many factors such as browsers, regulations, ad blockers, counting methods, aggregation methods and reporting interfaces.
    Yet, since AnyTrack's approach leverages both Client Side and Server Side tracking, it constantly enriches and collect data, regardless the tracking limitations.
    There are many possible reasons for differences in tracking results:
    • Differences in how sessions are defined. For example, some analytics software counts search bots as visitors, while other software don't.
    • Google can only count visitors with JavaScript and cookies enabled. Some visitors might not allow cookies or JavaScript.
    • Customers can use browser extensions to block Google Analytics from tracking their sessions and purchases.
    • Discrepancies might be introduced because of different reporting time zones.
      It’s unlikely that identical tracking mechanisms are being used by each of the services, so your visitors aren't recorded equally.

      🚧

      Good to know:

      Details of tracking and recording methods and mechanisms are proprietary information and are not publicly shared.