Due to Gannett's large number of publications and platforms, the Data Collection team has created a single, in-house system called gciAnalytics to configure, track and route user event data across its network.
The system includes a client-side JavaScript bundle to manage third-party tags in the browser and a server-side tag manager for more secure and reliable data delivery when available.
By "tags" we mean third-party JavaScript libraries or APIs such as Google Analytics, Parsely, Comscore, Facebook/Meta, mParticle and other vendors used who need access to our user event data.
It also includes two first-party tags, gciAnalytics-Fastly (GCIAF), the server-side component of our tag manager, and the GUP Cookie Monster, used to reset user data after certain events on third-party platforms.
Step 1 - Determine UAID
To determine the correct tags and events to use for a site, each combination of market and platform gets a Universal Application Instance Identifier (UAID).
Use the selector below to browse the available UAIDs. If your application does not fit an existing UAID, contact Data Collection in the #ask-datacollection Slack channel.
Universal Application Identifier (UAID):
-TEALIUM-
See Sites for more details on site codes and publications, and Platforms for information on available platforms.
Step 2 - Add the SCRIPT tags
Once you've determined the UAID to use, include the following two lines of HTML as high up as possible in the DOM of your page, preferrably server-rendered in the <HEAD> tag:
Once the script tag has been loaded and/or the user data has been set, your application can send event data by making track calls like those below:
Choose Event:
window.gciAnalytics.track();
See Data Layer for more information on what data layer properties are available to be sent to gciAnalytics.
Step 5 - Validating and Debugger
gciAnalytics provides several ways of validating and debugging to ensure the correct events and data are being sent. Below are some helpful properties on the gciAnalyics object:
window.gciAnalytics.data - An array of all events sent to gciAnalytics during the current page load
window.gciAnalytics.vendorData - An object containing arrays of events sent to individual tag vendors
window.gciAnalytics.collectedData - An object containing data automatically collected by the client-side script on the first track call
window.gciAnalytics.config - The config object determined by the UAID
There are also hash parameters that can be added to the URL to help in debugging:
#gci-debugger=true - Enables debug mode to display play-by-play, warning and error messages in the browser console
#gci-pause=true - Pauses the runtime after each event is sent when in developer mode
#gci-test=true - Will send events to test accounts to avoid contaminating production data