The e-commerce tag is used to keep track of the e-commerce transactions happening on the site and empower analysis with revenue-related metrics.
It needs to be fired a single time on the confirmation page, after the transaction has been finalised, and needs the following mandatory parameters in order to function:
- Transaction ID, which is the unique identifier for that transaction
- Revenue, which is the total amount of the purchase
You can also include the following optional parameters:
- Currency, which is the currency used for the purchase and also in our platform for a potential conversion. Full technical documentation firing the e-commerce tag…
Google Tag Manager (Template)Section titled Google Tag Manager (Template)
Open your container and go to the templates section
Select Search gallery
contentsquareand select the Contentsquare - E-commerce data option
Click Add to workspace
Confirm your choice by selecting Add
Go to the Tags section and click the New button to create a new tag
Configure it by selecting the top-right button
contentsquareand select the Contentsquare - E-commerce data template that you’ve previously added to your container.
Give a title to the tag and add your GTM Variables to the Transaction IDs and Revenue fields.
Make sure to select a trigger that fires only on the confirmation page, or on all the pages that are needed to keep track of transactions, on which your variables are going to be populated.
If you would like to send Contentsquare the currency value as well, fill in the optional parameters section.
Save your changes and go back to your container. You should now see both the template and the newly created tag.
Google Tag Manager (Custom HTML)Section titled Google Tag Manager (Custom HTML)
Create a new tag and paste the following code in the HTML field:
Inside the script, replace all the placeholder variables with your GTM values (using the double brace notation:
These variables must be available in the “Variables” section of Google Tag Manager.
In the trigger list, select the “Confirmation page”, or create one if it doesn’t exist.
- Select the ”+” on the top right,
- Select “Choose a trigger type to begin setup…”
- Pick “Window Loaded”
- You don’t want this to be trigger on every page, so choose “Some Window Loaded Events”
- Add a condition to match only the confirmation page — for instance,
"Page URL" contains "checkout/confirmation"
- Save and name your trigger “Confirmation page”
TealiumSection titled Tealium
The Tealium extension will automatically fire the Contentsquare transaction code as soon as the transaction values defined have been populated in your
Adobe LaunchSection titled Adobe Launch
Head over to the rules tab and create a new one
Event ConfigurationSection titled Event Configuration
The E-commerce tag needs to be fired once on the confirmation page, after a transaction has been made and needs to be tracked. In order to do so, specify the path or the event to be used as a trigger. For example, if you want to target the confirmation page, you could use a similar condition:
If you have chosen the event+condition route, your setup should look similar to this:
Action ConfigurationSection titled Action Configuration
Select the Ecommerce Tag Installation action from the Contentsquare extension
You will then be prompted to fill in the required information by using either strings or Data Elements.
Given the dynamic nature of transaction details, it is required to have previously setup Data Elements with the requested information.
Commanders ActSection titled Commanders Act
Add a new tag to your container by choosing “Contentsquare (Builder)“.
Set the right Contentsquare template selecting Ecommerce.
Fill in all required fields with your Commanders Act variables.
(Optional) If your transactions have different currencies, send Contentsquare the currency value.
(Optional) If you are CS Merchandising customer, add items.
Select a trigger/perimeter that fires only on the confirmation page, and click Save.
Your Tag is ready to be deployed.
ShopifySection titled Shopify
In the overlay that appears select
Checkout and accounts.
Scroll down to the
Order status pagesection.
Additional scriptsfield, insert the same code snippet that you inserted in the
This is an example of the code including the Liquid Objects pre-defined. You can change these values if need be:
You may already have the Contentsquare Main Tag and other code in the field above: add this new code to the Contentsquare section.
Custom HTMLSection titled Custom HTML
First, assign a variable to the mandatory fields:
Then execute the following function to send the above information to Contentsquare:
You can also put it all together in a single snippet: