How to Connect AIQ to X via Google Tag Manager (fka Twitter)
Custom Events
First you will need to setup the custom events you will want to track. In this doc, we will show you how to setup the purchase event, but AIQ Ecommerce supports the following custom events.
'view_item',
'add_to_cart',
'remove_from_cart',
'begin_checkout',
'purchase'
Setup Custom Events
Navigate to Triggers > New > Custom Event
The event name must match the exact format you see in the above code block.
Custom Variable
First you will want to know the format of how we send our data layer. We follow Google's recommended format for the data layer. Everything is nestled in the ecommerce object.
ecommerce: {
currency: "currency",
transaction_id: "orderId",
value: total,
tax; tax,
items: [
{
item_name: "productName",
affiliation: "venue.name",
index: 0,
item_brand: "productBrand",
item_category: "productType",
item_category2: "productSubType",
location_id: "venue.id",
price: productPrice,
quantity: quantity
}
]
}
Setup Custom Variable
Next you will need to setup variables. This will ensure that the correct data from our data layer is sent to Twitter. Once again, we will continue to provide examples of the purchase event. We want the value property in the ecommerce object to be sent to Twitter, so the variable name will be ecommerce.value
Navigate to Variables > New User-Defined Variables > Data Layer Variable
Data Layer Variable Name = ecommerce.value
Data Layer Version = Version 2
Set Default Value = Enabled
Default Value = blank
Add Twitter Base Pixel Tag
Add new Tag > Twitter Base Pixel > Pixel ID
Add new Trigger > All Pages (Page View)
Add Twitter Event Pixel Tag
Add new Tag > Twitter Event Pixel > Enter in Event ID
Value = Value Variable we set up a few steps ago (Mine is called Value Variable)
Currency = USD (This is not a variable, so you can define it as your location's currency (USD))
Trigger = Custom event you want this fired on
Verifying Changes
Once you publish your GTM container and enable it in your AIQ Ecommerce store, you should then be able to verify the data is flowing using Google Chrome's Twitter Pixel Helper Extension. These changes will take a few minutes.
Need Help?
If you need assistance, reach out to AIQ Support anytime via chat widget within your AIQ Dashboard.



