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

Christina Hastenrath
The Startup

--

Photo by Harley-Davidson on Unsplash

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:

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…

--

--

Christina Hastenrath
The Startup

Molecular Biologist turned Software Engineer. I write about my code. Connect with me on Twitter @etTinchen