Google Tag Manager

Google Tag Manager

The Google Tag Manager integration allows you to send purchase events to Google Tag Manager.

Tracking Code Example

The following code snippet is an example of how to send a purchase event to Google Tag Manager. You can use this code snippet as a reference to send purchase events to Google Tag Manager. Replace YOUR_GTM_ID with your Google Tag Manager ID.

The code snippet must be placed on the Thank You page of your checkout flow.

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->
const urlParams = new URLSearchParams(;
const total = urlParams.get('total');
const customerName = urlParams.get('customerName');
const customerEmail = urlParams.get('customerEmail');
const currency = urlParams.get('currency');
const productId = urlParams.get('productId');
const productName = urlParams.get('productName');
const purchaseId= urlParams.get('purchaseId');
    event: "purchase",
    ecommerce: {
        transaction_id: purchaseId,
        value: total,
        currency: currency,
        items: [
                item_id: productId,
                item_name: productName,
                price: total,
                quantity: 1