Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add google tag manager with download data event tracking #581

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

smcalilly
Copy link
Contributor

@smcalilly smcalilly commented Nov 22, 2021

Overview

For issues:

Notes

This new setup requires some orchestration between the new-ish Google Tag Manager console and the familiar Google Analytics console. It took more time than expected to figure it out, but I understand it now (somewhat). GTM provides non-technical users a way to setup Google Analytics event tracking within the GTM admin console, without making any code changes.

Google Tag Manager console

I followed this guide to implement the click tracking.

In the Google Tag Management console, I created two triggers:

  1. Download Source Data Event
  2. Download Standardized Data Event

Both of these triggers are attached to the same Download Data Event Tag.

Google Analytics console

When a user clicks on either of the links for the triggers, it will log in Google Analytics with the download_data_event.
Screen Shot 2021-11-22 at 11 37 41 AM

BGA users will be able to distinguish between the download triggers (standardized data vs source data) with the help of values in download_data_text and download_data_url. We can separate these two triggers to have their own tags if we want, but for this iteration all download events are tagged as a download_data_event.

Note that the Google Tag Manager in GA4 tracks file downloads by default. I turned this off since I thought it would be confusing to have two different file download event types, and decided to consolidate under this one custom download_data_event. Also, the source file was the only download tracked by this, since the new data download requests the server and doesn't have a filename (which is used by GA4 to determine if it's a file_download event)

Testing

  • Use this branch locally: git pull origin google-tag-manager.
  • Download source data and the new standardized data.
  • Go to the Salary property in Google Analytics
  • In the Realtime Overview, make sure you see the different events in the download_data_event type. Apparently it takes some time for the events to show up in the Engagement section.

@smcalilly smcalilly changed the title add google tag manager tags add google tag manager with download data event tracking Nov 22, 2021
@smcalilly smcalilly marked this pull request as ready for review November 22, 2021 17:55
@fgregg fgregg merged commit f44156d into master Nov 23, 2021
@fgregg
Copy link
Member

fgregg commented Nov 23, 2021

Very cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants