pressbooks / pressbooks-book-directory-fe

A Vue.js frontend for the Pressbooks Directory
0 stars 1 forks source link

Connect Directory with Google Analytics #142

Closed SteelWagstaff closed 3 years ago

SteelWagstaff commented 3 years ago

We'd like to connect Google Analytics to our production directory to better understand how visitors are using our site and the types of devices they're accessing the Directory with.

ADDITIONAL READING: https://www.algolia.com/doc/guides/building-search-ui/going-further/integrate-google-analytics/js/ https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/understand-reports/how-to/connect-search-with-google-analytics/ https://www.algolia.com/doc/tools/crawler/guides/enriching-extraction-with-external-data/how-to/linking-google-analytics/ https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/how-to/enrich-your-records-with-google-analytics-data/

Steel to review & test

richard015ar commented 3 years ago

@SteelWagstaff it is on Dev and Staging now. If you want to track information from those environment (for testing or any other reason) I can enable it by adding the environment variable needed. Otherwise we could test it directly on production once it is deployed.

richard015ar commented 3 years ago

Tests result

I deployed it to staging and I tested it using the staging measurement id, and it works as expected. I enter to staging.pressbooks.directory, I applied some filters and performed some search and the page view and other information was sent to analytics. It can be tested quickly using the "Real time" section in Google Analytics dashboard.