consumerfinance.gov
consumerfinance.gov copied to clipboard
Google Analytics and Tag IDs should be in environment var
Google Analytics ID is pegged against .consumerfinance.gov addresses, which appears like it'll conflate beta.cf.gov and www.cf.gov traffic together.
https://github.com/cfpb/consumerfinance.gov/blob/master/cfgov/jinja2/v1/_layouts/base.html#L216
This also makes it so any forks of this project need to go in and edit hardcoded values. Instead I'd suggest we aim for a centralized config file of some sort for customizing project credentials of this sort.
Additionally, Google Tag Manager should have the same configuration. This PR highlights how easy it is to miss when the wrong environment credentials are used because they are buried in the codebase.
Further reading http://stackoverflow.com/questions/25862071/accessing-os-environment-variables-from-jinja2-template