Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a one file change to implement google's gtag on the /companies page so we can track user interaction there. In the future we could extend this to metrics.js - but lets do one step at a time. Also, this version will not throw errors if GOOGLE_PROPERTY_ID is not set.
I have tested this on democracy-lab-dev.herokuapp.com with the GOOGLE_PROPERTY_ID env var and the GOOGLE_TAGS_ID set, which is how we have it set in production.
In production we are using the GOOGLE_PROPERTY_ID that corresponds to the google analytics data stream that we see at analytics.google.com.
The GOOGLE_TAGS_ID that we have set, is not what analytics is telling me to use to setup tag manager. So, I suspect that the GOOGLE_TAGS_ID is sending data to some other account and we are not seeing it.
A future step might be to change the GOOGLE_TAGS_ID but lets' leave that for now. We are trying to get to data on the companies page so we can make improvements.