The E-commerce tag
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
-
Type in
contentsquare
and 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
-
Search for
contentsquare
and 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:
{{transaction id}}
,{{transaction revenue}}
).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”
Tealium
Section titled TealiumThe Tealium extension will automatically fire the Contentsquare transaction code as soon as the transaction values defined have been populated in your utag
datalayer.
Adobe Launch
Section titled Adobe LaunchNavigate to Rules, and open an existing rule or create a new one.
Event Configuration
Section titled Event ConfigurationThe 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 Configuration
Section titled Action ConfigurationSelect the Contentsquare extension and then Ecommerce Transactions as the action type.
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 Act
Section 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 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.
Shopify
Section titled ShopifyTo track e-commerce data, track the checkout flow which retrieve all the data at the same time.
See Track the Checkout flow with Contentsquare.
Custom HTML
Section titled Custom HTMLSupply the transaction ID, revenue, and currency ISO code as parameters to the ec:transaction:create
command.
Then execute the ec:transaction:send
command to send the transaction to Contentsquare.