Skip to content

Website Google Analytics

Andy Lo edited this page May 11, 2018 · 4 revisions

Configuration

The Google Analytics tracking ID for the website is configured via JavaScript and should be set in the appropriate environment's configuration file under _app/config/ for the SDG National Reporting Initiative website.

Within each configuration file, you will see a configuration object named config. Set the analyticsID attribute (create it if it does not exist) to the tracking ID you want. When the website is rebuilt, it should be using the newly configured tracking ID.

Event Tracking

Please read the official Google Analytics documentation on implementing event tracking for detailed guidance.

The only events being tracked are resource link clicks. This is performed using the trackResource method for the resource-list Vue component. You can find these defined in _app/vue/resource-list.vue.

Clone this wiki locally