Google Tag Manager makes setting up event tracking like button clicking, form clicking or link clicking extremely easy – unfortunately, there is no direct option to send this data to Active Campaign yet.
In this video, we’ll teach you how to send dynamic event tracking data to Active Campaign with the help of GTM and a Google App Script.
LINKS MENTIONED IN THE VIDEO
Download the script here: https://measureschool.com/actracking
Outbound link click tracking: https://www.youtube.com/watch?v=ABo-Sk1QzrQ
Pre Fill Form Fields with email: https://www.youtube.com/watch?v=z20G9NqphYY
Google Tag Manager: http://back.ly/AdQ8
Active Campaign: http://www.activecampaign.com/?_r=K93ZWF56
Looking to kick-start your data journey? Hire us: https://measureschool.com/services/
RECOMMENDED MEASURE BOOKS: https://kit.com/Measureschool/recommended-measure-books
GEAR WE USED TO PRODUCE THIS VIDEO: https://kit.com/Measureschool/measureschool-youtube-gear
– Event tracking like button click tracking, phone tracking or link tracking is quite hard to set up. Google Tag Manager makes our life easier but unfortunately there’s no direct connection you can use to send event tracking data to the email marketing automation tool Active Campaign until now. In this video, I’m gonna show you how you can send dynamic event tracking data to Active Campaign with the help of Google Tag Manager and a Google Apps Script.
All and more coming up right after this. Hi there and welcome to another video of measureschool.com where we teach you the data-driven way of digital marketing. My name is Julian and on this channel we do tutorials, how-to videos and take a look at the latest marketing tech just like this one. So if you haven’t yet, consider subscribing.
Now we have been using the great email marketing automation tool Active Campaign on measureschool.com for quite some time now. The capabilities of Active Campaign path with the inexpensive price is quite amazing and as you might know, we’re always looking for ways to make the data that we track with Google Tag Manager more useful and more actionable. We’re looking for a way on how we can send data to Active Campaign via Google Tag Manager.
How would this actually look like in the end? Let’s go over to Contacts. And here we would see our contacts that we have currently on our list. Now we wanna send event data into one of these contacts. For example here, we want on this profile to show up on the All Activities our event tracking. Now there is something called Site Tracking as well which is pretty easily installed.
This will only give the URL that the user visited and not interaction data that you can actually track with the help of Google Tag Manager. Before we can get started we need to do some configurations so let’s go over to our settings and look on the tracking here. And here we can install our site tracking. Now, this is as I mentioned just a code that you can plug into your Google Tag Manager account to find all the pages, some of them to our page view tag that we file for Google Analytics in order to do page view tracking. But we want to actually go with the more advanced event tracking option which lets us send in custom data to our account dynamically with the help of Google Tag Manager.
Activate this option and what we need right here is our event key and later our account ID. This is something that we need to copy in a second. Now down here you need to actually define your events in advance, so you can’t just send in any data into Active Campaign. You need to define your events in advance and there are always two fields available. The actual name of the event and then the event data.
For example, I could predefine events like clicked or watched or added to cart, and these would now all be available to be sent into Active Campaign with custom data attached to them. How can we send data into Active Campaign?
Now, this is where the magic happens. We will send the request into our Apps Script. It will take the data, populate our API keys and then send that data onto the Active Campaign event tracking API. To make a copy of this proxy, you can head over to measureschool.com/aceventtracking then you simply need to make a copy of this script into your own Google Drive account. And you’re ready to use this Apps Script. Now we need to fill out two parameters here, one is the API key and then the Active Campaign ID.
How you can find them is described here but as I mentioned already, we have here our event key. This is the key that we need to put into our copy right here. And then we need to have our account ID which we have right here. Copy that over and replace that. That should do it. Let’s save this. And the last step we need to go through is actually publish it so let’s go to this publish button and deploy as a web app. And the only setting we need to change here is that it is accessible to everybody and we can deploy it as app.
Now, you will be granted to give this app permission to actually send data out and receive data. We’ll connect to external services, allow this and we get our web app URL. Now with this URL, we can send our request. So let’s open up a new tab here and I’m gonna enter our URL, and this only works if you have the right query string attached. What is this query string?
I have a little example here. It’s basically the question mark and then the key value path, the key email, the key event and the key event data. And after the equal sign you would put your values, so you need to define the email that this event should go to. You need to define the event which we have defined previously in our settings. And the event data and this can be dynamic that is attached to this event. Let’s present it here. We get a response that this was successful so we can go back to our account into the right contact that we sent this to.
And we see now a new activity has been tracked. A click event with the value that we sent over of test. This works as expected. Now, how can we make this useful in Google Tag Manager. Well, we can use this URL, let’s copy that, to fire an event. Now on my Google Tag Manager account, I have come up with a little example where I sent over an event for Outbound Link Clicks to Google Analytics. Let’s go into our preview in debug mode here, try these all out.
Here we have our website, our preview in debug mode opened and if we click with the command key pressed on an outbound link this will fire an event which carries the values of event category Outbound Link Click and the event action is the URL that was actually clicked. How can we simulate this with our Active Campaign tracking script? Let’s go back to Google Tag Manager and the click track has already defined.
We actually showed you how to accomplish the Outbound Link Click in another video that you can check out as well if you wanna replicate this. But now we want to build our AC tracking script and what we would need to do all these is actually three values. Again, the event key that we have already defined which is click, the click URL and the email address that we want to attach this to. Now, there are different methods of actually getting the email address from the user. One would be to actually get the email address once it comes from a newsletter for example that you sent out.
You could put that into the query string itself and put it into a cookie so it’s available to use later on. We actually show you how to do this in another video on pre-filling a form field where this method is also used. You could also capture the email address once so it fills out the form or the preferred way doing it with Google Tag Manager would be to send that information into the data layer.
This would obviously also only happen if the user is logged in. On our example here we have a plug in running that lets us, pre-fills our data layer for us so in this first message here we have the visitor email that is currently locked in. I’m locked in on this online store right now and therefore, thi