You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > TronShop Docs > How to add a tracking code to TronShop (e.g. CSS Scripts, Google Analytics, Google Ecommerce, Google Enhanced Ecommerce, etc.)
How to add a tracking code to TronShop (e.g. CSS Scripts, Google Analytics, Google Ecommerce, Google Enhanced Ecommerce, etc.)
print icon

In this article you can find the following instructions: 

 

1. How to implement Google Tracking (tracking visitors and pages)

2. How to implement Google Ecommerce Tracking (tracking orders and order details)

3. How to implement Google Analytics/Enhanced ecommerce - new placeholder {{GOOGLE_ECOMMERCE_ITEMS_ARRAY}}

 

You can add tracking codes to TronShop really simply. Just go to the admin portal > Settings > Advanced Functions > External Scripts. Here you only need to add the script by clicking on the + button, choose where to display it and copy the code into the field. The change will be reflected on the website immediately after saving.

 

1. How to implement Google Tracking (tracking visitors and pages):

Go to the section Settings > Advanced Functions > External Scripts and click on the button (ADD).

Now fill in the mandatory fields Name, Script target and Script position. Very important is “Script target” and select right option “EVERY PAGE – EVERY USER” (script will be rendered into any HTML page of webshop to track every pageview).
You can also select from 2 option in „Script position“:

  • In Head Section – webshop can be a little slower, but more visitors will be tracked
  • Before Body End – webshop can be little faster, but some visitors (who quickly exit) won’t be tracked … we recommend this option

Then insert the appropriate Google Tracking script, in which:

  • change “YOUR-GOOGLE-IDENTIFICATOR” to ID provided by Google
  • you can use different script provided by Google (like Google Tag Manager) – in this case use only appropriate identificator to your script version


And then just click SAVE.

 

 

2. How to implement Google Ecommerce Tracking (tracking orders and order details):

Go to the section Settings > Advanced Functions > External Scripts and click on the + button (ADD).

 

Now fill in the mandatory fields Name, Script target and Script position. Very important is "Script target" and select right option "ORDER CONFIRMATION PAGE" (script will be rendered into HTML only at this specific page with order confirmation).

 

Then insert the appropriate Google Ecommerce script, in which:

  • change "YOUR-GOOGLE-IDENTIFICATOR" to ID provided by Google
  • use available placeholders {{CODE}} shown in the screenshot below - they will be replaced by appropriate value
  • you can use different script provided by Google - in this case use only appropriate placeholders to your script version

 

And then just click on SAVE.

 

 

This is example how webshop render JavaScript code to track all items in stored order. This code is replaced instead of {{GOOGLE_ECOMMERCE_ITEMS}} placeholder. If you leave this placeholder, this items won’t be generated and tracked. If you need different structure of JavaScript code to track order items, it is unfortunatelly not possible now. It only can be developed as custom service. Contact us in this case.

 

 

3. How to implement Google Analytics/Enhanced ecommerce - new placeholder {{GOOGLE_ECOMMERCE_ITEMS_ARRAY}}

Now there is another way to generate a list of items in an external google enhanced ecommerce script.

We added a new placeholder {{GOOGLE_ECOMMERCE_ITEMS_ARRAY}} which will generate an array of products - see below.

For more details about the use, see google enhanced ecommerce documentation: https://developers.google.com/analytics/devguides/collection/ua/gtm/enhanced-ecommerce#purchases

 

Using the placeholder in a script:

Feedback
0 out of 0 found this helpful

scroll to top icon