Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Latest commit

 

History

History
28 lines (18 loc) · 1.1 KB

google_analytics_setup.md

File metadata and controls

28 lines (18 loc) · 1.1 KB

Set up Google Analytics credentials in development

To be able to import data from Google Analytics, a few environment variables need to be set.

  1. Create files config/local_env.yml

N.B. This file has been added to .gitignore, so you don't need to worry about accidentally checking it in.

local_env.yml is used to

  • Create the environment variables required to connect to and query the Google API for Google Analytics
  • Store your Google API credentials. They can either be downloaded from the google developers console or from another team member.
  1. Add an entry to config/local_env.yml for each of the following:
  • GOOGLE_PRIVATE_KEY
  • GOOGLE_CLIENT_EMAIL
  • GOOGLE_ANALYTICS_GOVUK_VIEW_ID

e.g.

GOOGLE_ANALYTICS_GOVUK_VIEW_ID: "1234567"

This will make "1234567" available as ENV["GOOGLE_ANALYTICS_GOVUK_VIEW_ID"]

GOOGLE_ANALYTICS_GOVUK_VIEW_ID is the view id on Google Analytics for www.gov.uk

See "Option Three" in Rails Environment Variables for more information