Contact salesTry for free

Read data from Google Sheet to server Google Tag Manager

Ivanna Holubovska

Ivanna Holubovska

Author
Updated
Oct 24, 2022
Also available in

Server Google Tag Manager can accept data from multiple sources like websites, CRMs, webhooks, etc. With the latest integration of Firestore and sGTM, we now have even more opportunities for data sources. Stape created a variable that adds Google Sheet to this list - you can read values from cells or ranges in your sheet and use it as an input into Server GTM.

We already have a blog post that explains how to write data from sGTM to Google Sheet. This article will show how to read data from Google Sheet and use it inside server Google Tag Manager.

How does Spreadsheet Reader variable work

There are three types of actions that this variable can do:

  1. Read cell. Reads and returns data from one Google Sheet cell.
  2. Read Range. Reads any field range within Google Sheet. Variable returns arrays of values.
  3. Read Two Columns. Add a range that includes two columns. Variable returns an object that consists of these two columns. The first column is used as a name, and the second - correspondent value.

Spreadsheet Reader variable use cases

The first use case that comes to my mind is enriching sGTM using a Google Sheet table. Let’s say there is a Google Sheet document with a user ID and user email. You can get a user ID in sGTM. With the help of Spreadsheet Reader, you can enrich data with user email by finding the corresponding user ID in Google Sheet. It will help enhance user parameters, for example, for Facebook conversion API, increasing the match quality score of Facebook conversion API events.

What do you need to use Spreadsheet Reader variable?

     4. Firebase account

How to set up Spreadsheet Reader variable?

1. Download Spreadsheet reader variable from GitHub or add it from the sGTM Template Gallery -> Import Spreadsheet variable to server Google Tag Manager by clicking Templates -> New Variable Template -> Click three dots in the top right corner -> Click import -> Add template that you’ve recently downloaded -> Click Save.

import google sheet variable

2. Create a new variable -> Select action type; in this guide, I will show how Read Two Columns option works -> Add columns range. This method works only with two columns and returns an object that consists of these two columns. The first column will be used as a name, and the second column will be used as a correspondent value. 

author

Ivanna Holubovska

Author

Content contributor at Stape.io, focusing on server-side tracking, digital marketing, and innovative solutions to optimize online business performance. optimize online business performance.

Comments

Try Stape for all things server-side

What’s going on?

Where are we going?

Attention!
This is a stand-up dog zone.