consumerfinance.gov icon indicating copy to clipboard operation
consumerfinance.gov copied to clipboard

Google Analytics and Tag IDs should be in environment var

Open anselmbradford opened this issue 10 years ago • 1 comments

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.

anselmbradford avatar Apr 29 '15 13:04 anselmbradford

Further reading http://stackoverflow.com/questions/25862071/accessing-os-environment-variables-from-jinja2-template

anselmbradford avatar Aug 18 '15 18:08 anselmbradford