Directions for implementing Google Analytics via Google Tag Manager

Note: It is recommended that you contact the CA Web team to establish your Google Tag Manager account. This will ensure the long-term availability to this important resource in the event of State agency staff turnover.

Regardless of what other customized tracking you may do through Google Tag Manager, you still must collect the State of California standard set of analytics. The best way to ensure that you are following standards, is to download the following file to import a standard Google Tag Manager template for implementing statewide standards.

Statewide standards Google Tag Manager template (ZIP)

Save the ZIP file, extract the JSON file, and follow the import steps shows below.

Note: Upon implementing the standard Google Tag Manager template within your Google Tag Manager account, you will need to change the State agency Google Analytics code (default value of UA-20973992-30) with your own state agency’s Google analytics code. Be careful to not change the Statewide Google Analytics code, otherwise your website’s traffic will not be collected for Statewide analytics purposes, and will be violating State Analytics policy.

(1) Within GTM container, navigate to the ‘Admin’ tab for the ‘Default Workspace’

 

 

(2) Select ‘Import Container’

 

 

(3) Select the relevant JSON file, assuming this is a brand new GTM container select the ‘Default Workspace’, then select ‘Overwrite’ as an import option. Click ‘Confirm’

 

(4) Once the file is imported, the workspace will need to be published for the changes to take effect.

Important: before you publish, you must modify the Javascript variable that contains the UA-code for your Google Analytics dashboard. Open up the JS – customTask hit duplicator 2 properties variable, and change the UA-20973992-30 to your UA-code for your own dashboard.