Receive realtime Google Tag Manager monitor notifications using Zapier
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:
- You can choose any destination for your GTM monitor notifications.
- You can choose to send the notification payload to multiple destinations.
- You can filter the payload before you send it to a destination.
- You can reformat the payload before you send it to a destination.
- 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.
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’
Step 4 From the built-in apps select ‘Webhooks’ and continue.
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.
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.
This should result in something like this:
Step 10 Continue, then select the app you want to send the values to. In this example I have once again chosen for Slack.
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
Step 12 Select the account you want to send your values 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.
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.