Set up the Google Analytics Settings in GTM

The Google Analytics Settings variable will help you to define most of the Global Property's standards and which information/values do you want to send.

Basic Setup

1) Go to the variables section in Google Tag Manager container.

2) Create a new variable and select the type Google Analytics Settings.

3) Add the Global Property Tracking ID UA-109290164-1 and leve the Cookie Domain value as auto.

Custom Fields

1) Go to More Settings > Fields to Set.

2) Follow the table below to set up three different fields. These values should enable cross domain tracking and IP anonymization and block Google's advertising features.

Field

Value

allowLinker

true

anonymizeIp

true

allowAdFeatures

false

Setting up allowAdFeatures to false will also block Google Analytics from collecting user demographic data.

IP-Anonymization Info: As mentioned in the General Data Protection Regulation (GDPR), IP addresses do qualify as personal information. We decided, therefore to turn on IP anonymization in Planet 4 Google Analytics to ensure that full IP addresses are never written to the disk. Turning on IP anonymization is easily set up Tag Manager, just by adjusting your tag or Google Analytics Settings variable with the custom fields above.

Custom Dimensions

The following custom dimensions should be enabled in your Google Analytics Settings Variable. Those should be sent from your primary website (eg. greenpeace.org) and from your landing pages (petitions and donations pages).

The custom dimensions below are automatically enabled in each view of the Global Property (Google Analytics). Follow the exact index number used below:

Index

Dimension

Scope

Setup Instructions

1

Internal Traffic

User

2

Global Project

Hit

3

Language

Session

4

Entry Point / Custom Query

Session

5

Tags

Hit

6

Office

Hit

7

NRO

Hit

8

Basket

Hit

9

Scope

Hit

10

Local Project

Hit

11

Author

Hit

12

Platform

Hit

13

Post Date

Hit

14

Cookie Status

User

15

global_project

Session

16

Visitor Type

User

17

Project ID

Hit

Always make sure the index (number) is the same in both Google Tag Manager variables and in the custom dimensions set up in the Google Analytics property.

There are different Tag Manager setups for the custom dimensions defined in the Google Analytics Settings. Follow the instructions below:

Hardcoded Dimensions

The value for these dimensions can be defined directly in the Google Analytics Settings:

Index

Dimension

Value

Example

3

Language

Spanish

6

Office

Argentina

7

NRO

Andino

If you're using a multi-lingual website, you can follow the instructions here.

DataLayer Variables

Use dataLayer variables to capture the dimension values and send to Google Analytics as custom dimensions. Follow the structure below:

Index

Dimension

DataLayer Variable

2

Global Project

gCampaign

8

Basket

gBasket

9

Scope

gScope

10

Local Project

gLocalCampaign

12

Platform

gplatform

16

Visitor Type

visitorType

17

Project ID

projectID

Not sure what is a dataLayer variable or how to create one? Check more information about dataLayer here.

Custom Queries

In Google Tag Manager, navigate to variables and create a new user-defined variable with the type 'URL'.

After that, select the component type 'Query' and input the 'Query Key' as entrypoint. Save the new variable as 'url query - entrypoint'.

See the example below:

Now don't forget to go back to your Google Analytics settings and add this new variable you created under the Custom Dimensions. See the table above to get the right index number.

Custom setup

Given that we are not tracking IP addresses, it is important that all employees add one additional step to exclude internal traffic from being consolidated. This can be done by placing a custom cookie in all employees’ browser. This must be done on all devices and in all browsers an employee might use to access any site of P4.

The scope of this custom cookie is restricted to the host. So if the host is www.greenpeace.org, it always works in www.greenpeace.org only.

For other hosts like act.greenpeace.org, you’ll need to do the same thing by sending the staff a link with “?internal” at the end of it.

To place the cookie in a browser, please visit this URL https://www.greenpeace.org/international/?internal (or any /yourdomain/?internal)

A regular reminder asking GP staff to place this cookie in their browsers is enough to exclude of 80% of internal traffic!

This will redirect you to the Home of your P4 site, and place a cookie in your browser that excludes your browsing behaviour from showing up in Google Analytics reports, regardless of which IP the employees is accessing the site from. This is crucial, as employees browsing behaviour is irregular and will skew the reporting in Google Analytics.

It possible to have this cookie to exclude IP Address in other GA views than the GPI one (UA-10290164), just add the filter in your local view once you set it up in Google tag Manager.

Once you checked that the cookie is referenced to the right GA view, you have to add the filter to the view. It is a domain cookie, so it works on any of the local sites that use the same cookie…

For other hosts (aka cross-domain, see below) like act.greenpeace.org, you will need to do the same thing by sending the staff a link with “?internal” at the end of it and it should work fine.

If you connect your website to another / your NRO GA property, you will have to enable the custom dimensions yourself. You can create custom variables and add them to your GTM container. More info in this blog by Simo Ahava.

Content Groups

Use dataLayer variables to capture the page type values and send to Google Analytics as content groups. Follow the structure below:

Index

Content Group

DataLayer Variable

1

Page Type

pageType

Not sure what is a dataLayer variable or how to create one? Check more information about dataLayer here.

Cross-Domain Tracking

To track users across domains, we place the same _ga cookie in users’ browsers when they click from one domain to another. This is handled entirely in GTM, using the allowLinker field, which appends the _ga ID to the URL on which a user click, and a variable that contains all the domains that should be linked. This variable is named “crossDomains” and contain a comma-separated list of domains.

(1) Go to More Settings > Fields to Set.

(2) Add a variable including all the domains that should be tracked

If you don't have a crossDomain variable, you can easily create one at your Tag Manager > Variables > New. Select the variable type "Constant" and add all domains you want to track.

(3) Remember to keep the variable {{crossDomain}} always up to date. It should include all domains you want to track (including advocay and fundraising domains).

Last updated