In the competitive world of e-commerce, understanding your customers and optimising your advertising efforts is crucial for success. However, traditional pixel-based methods are facing increasing limitations, especially with growing data privacy concerns and browser restrictions like Apple’s iOS updates. Enter the Snapchat Conversion API, a powerful solution that empowers Magento store owners to overcome these hurdles and achieve reliable, privacy-focused conversion tracking. This comprehensive guide will walk you through the process of setting up the Magento Snapchat Conversion API using the robust capabilities of Google Tag Manager (GTM) Server-Side. By leveraging server-side tracking, you gain enhanced data accuracy, improved user privacy, and greater control over your data.

The Power of Accurate Conversion Tracking

Before we dive into the technicalities, let’s understand why conversion tracking is so vital. Imagine this: you launch a compelling Snapchat ad campaign for your latest Magento product, driving traffic to your store. But how do you know if those clicks translate into actual sales? This is where conversion tracking bridges the gap, providing insights into which ad campaigns lead to desired actions like purchases, newsletter sign-ups or form submissions.

Snapchat Conversion API, paired with the robust capabilities of GTM server-side tagging, allows you to:

  • Measure ROI: Accurately attribute sales and conversions to specific Snapchat campaigns.
  • Optimise Ad Spend: Identify high-performing ads and allocate budget effectively.
  • Refine Targeting: Build custom audiences based on user behavior on your Magento store, enabling highly targeted retargeting campaigns.
  • Understand Customer Behavior: Gain valuable data on how users interact with your products and website, allowing for data-driven improvements to the customer journey.

Prerequisites: Gearing Up for Success

Before we dive into the step-by-step guide, ensure you have the following:

Optional but Recommended:

  • Basic Understanding of GTM: Familiarity with GTM Tags, Triggers, and Variables is essential for this setup.
  • Data Layer Implementation on Magento: Implementing a data layer can significantly streamline the process of passing conversion data from Magento to GTM. Our extension implements these data layers for you:- https://www.scommerce-mage.com/magento-2-ga4-google-tag-manager.html

Step-by-Step Guide: Setting Up Magento Snapchat Conversion API with GTM Server-Side

Step 1: Generate Your Snapchat Access Token

  1. Log in to your Snapchat Ads Manager account.
  2. Navigate to the “Business Dashboard” section.
  3. Select “Business Details” from the left menu and then under the “Conversions API Tokens” section click on “Generate token”. This token acts as a key, authorizing your Magento store to send data to Snapchat.
API Access Token Snapchat

Step 2: Configure Client-side Google Tag Manager

In order to set up the GTM server-Side tag we’ll need the specific data at the time a particular conversion occurs, however unfortunately, there’s no dedicated Snapchat client in the server-side GTM. Therefore, we’ll need to use the GA4 client itself, and send the required data through the GA4 client side tag to the server-side GTM.

Create a new tag on the client side where we will send all the information needed for our snapchat tag in server side. Create the event based on the following settings:-

  • Tag Name:- GA4-Snapchat-Conversion
  • Tag Type:- Google Analytics: GA4 event
  • MeasurementID :- {{GA4 Measurement ID}} (Add variable containing GA4 measurement ID)
  • Event Name:- snapchat_conversion
  • Event Settings Variable:- {{Google Tag Event Settings}} ( Add variable containing event settings for GA4)
  • Event Parameters
    • conversion_currency
    • conversion_revenue:- (Add variable containing conversion revenue from data layers)
    • conversion_hashed_phone:- (Add variable containing hashed phone from data layers)
    • conversion_hashed_email:- (Add variable containing hashed email from data layers)
    • event_id:- (use the custom variable templates to generate unique event id for each time the event fires)
    • conversion_time:-(Use the custom javascript variable to get the timestamp of the conversion in the UNIX format)
    • transaction_id:- (Add variable containing transaction_id from data layers)
    • qunatity:- Add the variable containing the total quantity from the conversion)
    • item_ids:- (Add the variable containing item ids during the conversion from data layers)
    • snapclick_id:- (click id can be stored and extracted from 1st party cookies)
  • Trigger:- We will fire this event when our custom event “conversion_pii” is pushed into the data layers. This is done because on this push we have all the values that we need for pinterest.
Snapchat Conversion GTM Client Side Tag

Step 3: Set Up Server-Side Container in GTM

  1. Set Up Server-Side Container: If you haven’t already, create a server-side container within your GTM account. This container acts as the intermediary between your Magento store and Snapchat.

Let’s first create the required variables first which we will use with our server tag:-

Variable Name:- Snapchat Event ID

  • Variable Type:- Event Data
  • Key Path:- event_id
Snapchat Event ID

Variable Name:- Snapchat Conversion Time

  • Variable Type:- Event Data
  • Key Path:- conversion_time
Snapchat Conversion Time

Variable Name:- Conversion Hashed Email

  • Variable Type:- Event Data
  • Key Path:- conversion_hashed_email
Hashed email

Variable Name:- Conversion Hashed Phone

  • Variable Type:- Event Data
  • Key Path:- conversion_hashed_phone
Hashed Phone

Variable Name:- Snapchat Click ID

  • Variable Type:- Event Data
  • Key Path:- snapclick_id

Variable Name:- Snapchat Transaction ID

  • Variable Type:- Event Data
  • Key Path:- transaction_id

Variable Name:- Conversion Currency

  • Variable Type:- Event Data
  • Key Path:- conversion_currency

Variable Name:- Conversion Revenue

  • Variable Type:- Event Data
  • Key Path:- conversion_revenue

Variable Name:- Snapchat Item IDs

  • Variable Type:- Event Data
  • Key Path:- item_ids

Variable Name:- Snapchat Quantity

  • Variable Type:- Event Data
  • Key Path:- qunatity

Create trigger

Create the trigger based on the following settings:-

  • Trigger Name:- Snapchat Client
  • Trigger Type:- Custom
  • This trigger fires on:-
    • “Client Name” Equals “GA4”
    • “Event Name” Equals “snapchat_conversion”
Magento Snapchat Conversion API Trigger

Let us create the tag with the settings mentioned below.

The Snap Conversions API tag isn’t available by default. You’ll need to search for and import it from the GTM tag gallery provided by Snapchat.

  • Tag Name:- Snapchat Conversion
  • Tag Type:- Snap Conversions API
  • Pixel ID :- Add your snapchat pixel ID
  • API Access Token:-  Add API access token created in the earlier steps.
  • Event Name Setup Method: Override:Standard : purchase
  • Action Source: web
  • Server Parameters
    • Event ID : {{Snapchat Event ID}}
    • Event Time: {{Snapchat Conversion Time}}
  • User Data Parameters:
    • Email: {{Conversion Hashed Email}}
    • Phone Number: {{Conversion Hashed Phone}}
    • Snap Click ID : {{Snapchat Click ID}}
  • Custom Data Parameters:
    • order_id: {{Snapchat Transaction ID}}
    • Currency: {{Conversion Currency}}
    • Value: {{Conversion Revenue}}
    • content_ids: {{Snapchat Item IDs}}
    • num_items: {{Snapchat Quantity}}
  • Triggering: Pinterest Checkout
GTM snapchat conversion api tag

Test the Setup

Use the Google Tag Manager preview mode to check whether the tag is firing correctly and includes all the correct parameters.

Verify the conversions reaching in snapchat ads from the Events Manager.

Snapchat Events Manager

Conclusion

Setting up the Magento Snapchat Conversion API using GTM Server-Side tagging can be a complex process. However, our extension simplifies this entire setup, saving you time and potential headaches. Our module comes with a pre-configured GTM setup JSON import file, which includes all the necessary tags, triggers, and variables we’ve discussed in this guide. By purchasing our extension, you can implement this powerful tracking solution with just a few clicks, allowing you to focus on what matters most – growing your business and optimising your Snapchat ad campaigns. Don’t let technical hurdles hold you back from leveraging the full potential of the Snapchat Conversion API.

Magento 1:- https://www.scommerce-mage.com/magento-ga4-google-tag-manager.html

Magento 2:- https://www.scommerce-mage.com/magento-2-ga4-google-tag-manager.html

Similar Posts