Make Algolia Search Results More Relevant With Google Analytics API and Github Actions
How to get Google Analytics page view data into Algolia records via NodeJS, Github Actions, and Github Secrets
This is a step-by-step tutorial on how to connect your Google Analytics (GA) pageview data with your Algolia Index data. This blog post assumes that:
- you already have an Algolia instance up and running
- you have already set up GitHub Actions
- you are already tracking pageviews with Google Analytics and have pageview data to import to Algolia
If you are new to Algolia, 👉 check out my blog post on how to implement Algolia on a Gatsby Site 📚
I am going to show you how you can optimize search results being returned from Algolia by adding GA pageview data to your Algolia Index.
We have implemented Algolia on our Gatsby app and we are deploying the app via Github Actions to AWS, thereby using Github Secrets to set environment variables.
The auth of the Google Analytics API was not as straightforward as the docs say, since we have…