Skip to main content
Skip table of contents

Google Tag Manager (PA SDK Template)

About Google Tag Manager

Tag Manager, part of Google marketing Platform and closely integrated with Google Cloud, allows you to easily setup tags, their triggers and variables from many solutions, both Google and non-Google, without coding.

Learn more at https://support.google.com/tagmanager.

PA Connect Google Tag Manager

The PA Connect Google Tag Manager provides a plugin using our latest PA SDK tagging methods, in GTM's Custom Template Library.

This plugin allows Piano Analytics tags to be triggered through GTM on the events generated on your site.

  1. Native connector: Simply import the Piano Analytics plugin from Tag Manager's tag addition. 

  2. A central place to trigger all tags: Using a Tag Management System allows you to coordinate all tags fired by your site from one place. You can also rely on the same variable for various solutions.

  3. Collaboration: Work with your team on the tag's variables and their use, tags, triggers and variables can easily be edited by everyone in your team.

Import templates

Tag Templates

Go to the Templates tab on the GTM interface, and click on Search Gallery from the Tag Templates section. Then search for the template Piano Analytics

- Tagging:

screenshot1 doc-20240927-101418.png

Variable Templates

Stay in the Templates tab and click on Search Gallery from the Variable Templates section, to find the Piano Analytics - Configuration template:

screenshot2 doc-20240927-101453.png

Fill your collection endpoint, site number, PA SDK source (up to date CDN file by default) and choose the default consent mode. :

screenshot3-20240927-101516.png

You can configure your Consent settings (documentation):

screenshot4-20240927-101609.png

You can also add any other configuration available with our JS SDK (documentation):

screenshot5-20240927-101627.png

Reminder : You can retrieve your collection information on the Data Collection Portal > Tagging > Collection Domains Piano Analytics interface.

Tag Settings

To manage your events, go to the Tags tab, and create a new tag with the previously customized Piano Analytics - Tagging template:

screenshot6-20240927-101646.png

Make sure you use the previously created Variable as the Configuration for the Tag.


Events

You can now choose the action you need this tag to achieve (events documentation). Fill the Event name and all the properties needed:

screenshot7-20240927-101701.png

To send multiple events, you need for each event name to associate a variable with a property object to be sent:

screenshot8-20240927-101715.png

The event properties object can either be a JS Variable, or a custom JS Variable:

screenshot9-20240927-101730.png

eCommerce Bridge

The template offers a native GA eCommerce bridge, that will automatically transform GA eCommerce tagging to Piano Analytics events and properties (documentation).

Default events mapping is displayed directly in the tag configuration:

screenshot10-20240927-101745.png

You can customize the properties mapping by adding new lines. Each line describes one mapping.

  1. The first field expects the Datalayer property name. You can prefix the value with $$ to give a value instead of a property name.

  2. The second field expects the Piano Analytics property to fill with the output.

screenshot11-20240927-101907.png

Set properties

You can set properties to subsequent events (documentation):

screenshot12-20240927-101922.png

You can set the type of the property to either a fixed type, or to let the template automatically detect the type (using JSON.parse JS method):

screenshot13-20240927-101943.png

Please note, however, that if you select a fixed type other than "Auto", your properties will be prefixed with this type (e.g. s:article for a string typed "article" property).
If this is your case, make sure you always keep this format, especially if you decide to exempt your prefixed properties.

Set a user

You can use this action to identify a logged-in user (documentation):

screenshot14-20240927-101959.png

Set consent mode (PA SDK > 6.8)

You can set a new Consent mode if the end-user changes its preferences (documentation):

screenshot15-20240927-102017.png

Set Privacy mode (PA SDK < 6.8)

You can set a new Privacy mode if the end-user changes its preferences (documentation):

screenshot16-20240927-102032.png

Override the Visitor ID (not recommended)

You can override our SDK management of the Visitor ID. This is however not recommended (documentation):

screenshot 17-20240927-102046.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.