Stape
Search
Try for free

Write data from server Google Tag Manager to Google Sheets

Updated
Nov 21, 2024
Published
Apr 16, 2022
Also available in

Google Sheets is a cheap and easy-to-use platform to collect and manage data. Though there are a lot of fancy CRM systems, around 40% of markets and salespeople prefer recording website leads, sales, and campaign results in Google Sheets. 

Connecting a website with Google Sheets allows you to automatically track any user interaction,  or conversion inside the spreadsheet, making it easy for your sales and marketing team to operate and analyze data.

Previously the easiest and fastest way to send data from websites to Google Spreadsheets was using tools like Zapier. The biggest concern about using Zapier is price. The free plan includes up to 100 tasks (records) per month. 

Stape team created Google Sheets tag for server Google Tag Manager. This blog post will show you how to write data from server Google Tag Manager to a Google Sheets using the Google Sheet tag for sGTM. Let's get started!

How can you use the Google Sheets tag

You can pull any data available in sGTM to Google Sheets. It can be event data, user data, website data, webhooks, etc. 

The first use case that comes to my mind is recording lead or sales data to the spreadsheet. You can add order information, traffic source, and UTM tags to the CRM. 

Google Sheets tag can also be helpful when debugging the sGTM setup. If you have some issues or doubts if the tag works correctly, you can send data to Google Spreadsheet to ensure all parameters were sent correctly. For example, let’s say you’ve implemented FB CAPI and think that sGTM does not send fbc parameters to FB, which affects conversion attribution to your FB campaigns. In this case, you can use the Google Sheets tag to add order IDs and fbc parameters to Google Sheets and see which orders were made after seeing a FB ad. 

What do you need to set up Google Sheets tag

Google Sheets Connection

If you are a Stape user, the process of the Google Sheets tag is simplified. Google authentication is entirely handled on the Stape side; you just need to use Google Sheets Connection to the Stape admin.

You can find Google Sheets Connection in the Connections tab. Then click sign in for Google Sheets and pass the authorization with your Google account.

Google Sheets Connection

How to set up Google Sheets tag

2. Send data to the server GTM container. The two most popular sending data to sGTM are Google Analytics 4 and Data Tag/Data Client.

3. Download and unzip a file with the Google Sheets tag from GitHub. Go to your server GTM → Templates → in the “Tag Templates” click “New” → import the file you downloaded.

Import Google Sheets tag

Or 

You can also add it via the server GTM Template Gallery.

Add via template gallery

4. Create a new tag. In the “Tags” section, click “New” and add the following configurations:

  • Type - add row or update cells;
  • Rows range and Spreadsheet URL;
  • Authentication Credentials - choose Stape Google Connection if you are a Stape user and signed into a relevant Google account.

Below is an example of tag configuration:

google sheets tag configuration

5. Add the trigger for a tag.

6. Test the tag. You should see it triggered correctly in the server GTM debugger:

Tag is fired

And the row should be added to the Google Sheets:

New row in Google Sheets

How to set Google Sheets tag up for non-Stape users

In case you don’t use Stape for server-side tracking or would like to handle your own authentication, you will need:

1. Enable Google Sheets API by using the link to Google Cloud Console, searching for “Google Sheets API” and clicking “Enable”.

Enable Google Sheets API

2. Google Service Account with corresponding permissions.

3. Choose Own Google credentials in the tag settings:

Own Google credentials

Conclusion

By connecting Google Sheets to your website, you can manage marketing campaigns and track conversions quickly. It will provide complete insight into which channels generate qualified prospects and act on new conversions faster.

If you need help setting up server-side tracking, please don't hesitate to contact us. We're happy to help! In the meantime, be sure to check out our other blog posts for more tips and tricks on using server Google Tag Manager.

Tagged with:sGTM tag

Try Stape for all things server-sideright now!