-
Notifications
You must be signed in to change notification settings - Fork 0
Google Tag Manager Setup
Google Tag Manager is a system where you can attach "tags" to a website which capture analytics for specific events (clicks, AJAX, etc...). It's predominantly a client side solution that is configurable through a web interface outside of the application that you are collecting analytics from. This architecture supports maximum flexibility to manage analytics tracking outside of the application code base therefore minimizing the need to re-deploy software for a change to the analytics.
Google Docs Reference: https://support.google.com/tagmanager#topic=3441530
While Tag Manager is predominantly managed through the Tag Manager interface there is some configuration that must happen in the DDMS code base. Primarily there is a need to capture events (AJAX) and send useful information to Tag Manager in a flexible way. TerraFrame has implemented these hooks in a way where AJAX requests are captured to provide enough information to support the current need for Tag Manager configuration as well as future modification.
- If you're organization doesn't have one already, setup a Google account that will be used to manage and store analytics data.
- Create a new Tag Manager account. You can have multiple Tag Manager accounts under one Google account. This is how you can manage analytics for multiple deployments through one administrative account.
- Prepare the default Tag Manger configuration container by replacing all the Tag Manager and Google Analytics account ID's using find and replace.
- Import the modified default Tag Manager configuration container to the new account.
- Register the Tag Manager account ID code with the deployed system using the DDMS manager.
- Validate the Analytics installation.
Your organization will need an account where the analytics data can be stored and manged long-term. Either a standard or business account will work for these purposes.
A Tag Manager `account is a sub-account under your general Google account. You can have multiple Tag Manager accounts. Each Tag Manager account maps to a website where you're capturing analytics from.
- From Tag Manager home click on 'CREATE ACCOUNT'.
- Give this new account a unique name that will help you identify it. This account will be used for a single deployment so make it identifiable to that deployment (ex: DDMS - India). Select the country the instance will be deployed to and click 'continue'.
- Enter a container name for the account. This is often a URL for the website but does NOT have to be a real accessible and live URL. For example, if the app will run on localhost you could enter 'http://localhost/Indiaddms'.
- Select the 'web' obtion at the bottom and click 'create'.
NOTE: After hitting 'create' and accepting the terms of service a modal will appear with the title "Install Google Tag Manager". You can access this information later from the administration section of the new account so you can safely close this modal to keep going or copy the Tag Manger ID now because you'll need it later. The ID is in the format GTM-xxxxxxx.
Google Docs Reference: https://support.google.com/tagmanager/answer/6103696
A configuration container is a configuration in JSON format that defines the Tag Manager configuration. This simple text based format enables the ability to easily share and duplicate Tag Manager configurations.
- Locate the default container configuration at ..future releases will include a reference to a configuration file..
- Open the container configuration file with a text editor (EX: Notepad).
- Search for and replace all existing Tag Manager IDs with your Tag Manager id. Tag Manager IDs start with "GTM-" followed by 6 to 7 characters.
- You can find your Tag Manager ID by navigating to 'Admin/Install Google Tag Manager' from your newly created Tag Manager Account. The ID is embedded in the tracking snippet. See the image in the last section (above) for an example.
- Search for and replace all existing Google Analytics IDs with your Google Analytics ID. Google Analytics IDs start with "UA-" followed by 6 to 8 numbers and a trailing "-1" (ex: UA-xxxxxxx-x).
- You can find your Google Analytics ID by navigating to 'Admin/Property Settings' from you Google Analytics account. The tracking ID should be at the top.
- Save the modified container configuration file.
Configuration containers can be imported to an account to ease replication of configurations across accounts.
- In Tag Manager navigate to 'Admin/Import Container'.
- Click the "choose container file" button and navigate to the file you just modified in the last step.
- At this point you haven't created a workspace yet so click "New" under the "Choose workspace" section. This will open a modal where you will need to give the workspace a name.
- Select the "Overwrite" option in the last section.
- Click "Confirm"
Google Docs Reference: https://support.google.com/tagmanager/answer/6106997?hl=en
6. Register Your Tag Manager Account With DDMS
Your Google Tag Manager account must be registered with DDMS to configure the backend code that sends tracking data to the Tag Manager cloud.
- Open the DDMS Manager and stop DDMS if it is running. The DDMS Manager must be stopped when modifying system configuration settings.
- Click on the settings button.
- Enter your Tag Manager and Google Analytics codes into relevant fields.
- You can find your Tag Manager ID by navigating to 'Admin/Install Google Tag Manager' from your newly created Tag Manager Account. The ID is embedded in the tracking snippet. See the image in the last section (above) for an example.
- You can find your Google Analytics ID by navigating to 'Admin/Property Settings' from you Google Analytics account. The tracking ID should be at the top.
- Save and start DDMS.
When setup correctly events configured in the container configuration will be tracked and sent to your Google Analytics account. We can validate the setup by performing an action in the DDMS deploy that fires an event and validating that it is registered in the Google Analytics web interface.
- Log in to Google Analytics.
- Navigate to 'REAL-TIME/events' in Google Analytics.
- In another tab, log in to DDMS and create a new Kaleidoscope.
- Go back to the Google Analytics tab and verify that an event was registered with Event Category equal to 'Kaleidoscopes' and Event Action equal to 'Create New'.
- Creating a New Installation
- Basic Server Maintenance
- Setting up a Development Environment
- Building the DDMS
- Notes about properties files
- Geoprism BIRT Javascript
- Offline Basemap Management
- DHIS2 Environment Setup
- HTTPS Setup with Lets Encrypt
- Google Tag Manager Setup
- ODK Environment Setup
- How Grids Work
- IRS And Query Builders
- Runway Metadata Update Process
- About Merg Form
- About Reloadable Infection