Receive realtime Google Tag Manager monitor notifications using Zapier

Matthew Niederberger
4 min readSep 6, 2019

--

In my previous article I shared an application I built to send realtime notifications to Slack using Google Tag Manager’s addEventCallback API in combination with a Custom Template. The goal, to improve data quality in combination with tag management tools.

During this process, I discovered that Slack’s Webhook functionality will be depracated. For that reason I made changes to my app to allow for POST requests to Zapier. In this article I will walk you through the process of setting this up.

The Zapier approach offers a lot more features, here are my top 5:

  1. You can choose any destination for your GTM monitor notifications.
  2. You can choose to send the notification payload to multiple destinations.
  3. You can filter the payload before you send it to a destination.
  4. You can reformat the payload before you send it to a destination.
  5. It offers a very nice free account that allows you to get started today.

Zapier Setup Instructions

Step 1 Implement my Google Tag Manager monitor app. Get the source code from Github and follow the steps from my previous article.

NOTE If you already setup my app, please make sure to update your code. Checkout the Zapier commit on Github.

Main changes for Zapier webhook integration

Do not deploy the updated code just yet, because you need the Zapier webhook URL.

Step 2 Create an account on Zapier, or login into your existing account.

Step 3 Click on ‘Make a Zap’

Get started by clicking on Make a Zap

Step 4 From the built-in apps select ‘Webhooks’ and continue.

Select Webooks

Step 5 Select the option ‘Catch Hook’ then click on Save + Continue.

Step 6 This is an important step. First, you want to copy the Zapier webhook URL.

Then paste it in the Firebase Functions code.

Paste your Zapier webhook URL in the zapierWebHookUrl variable

Once you are done, deploy the updated functions script.

Step 7 Once successfully deployed, go to Google Tag Manager, find the Custom Template and put the template into ‘test mode’ by changing the conditional statement on line #39 (originally explained in Step 12 in my previous article).

Step 8 In Google Tag Manager force the test error by testing the template at least 3 times (or whichever number you entered for the trigger).

Step 9 Back in Zapier click on ‘Ok, I did this’ and it will look for example values sent using the webhook.

Click on Ok, I did this to find example values sent to Zapier

This should result in something like this:

Example values received by the Zapier webhook

Step 10 Continue, then select the app you want to send the values to. In this example I have once again chosen for Slack.

Select your notification destination

Step 11 Walk through the step for Slack and decide:

  • how you want to send the values to Slack
  • to which channel you want to send the notifications to
Choose method for notification

Step 12 Select the account you want to send your values to.

Select the Slack account you want to send the notification payload to

Step 13 Fill in the Slack notification template. There are many options here. FIll them in as you see fit.

Step 14 Send the test values to Slack using your template and monitor the results in your selected Slack account and channel.

Tag names are always “undefined” when testing.

Step 15 Restore the state of your Google Tag Manager Custom Template line #39 to make sure you only capture tags with the status failure.

Congratulation! You are now all set to receive GTM failed tag notifications on any destination platform Zapier offers you.

--

--

Matthew Niederberger

I am a Tag Management Expert at Tagticians and help companies get to grips with optimizing their digital data collection activities. Father of 4, husband of 1.