Track outbound link clicks in Google maps

It is possible to track outbound links inside a Google maps map. Therefore it’s important you don’t use the embed functionality Google offers by default.  This creates an iframe with a Google maps map without your Google tag manager code.

A solution is loading Google Maps with the Google API loader. Here’s an example how to use it:

See it in action!

Change the Latitude, longitude, the map level and your Google tag manager snippet 😉

Navigate inside the Google Maps box to a location and open the popup box.

voorbeeld google maps

The outbound link in my example is the one we would like to track. Right click on it to inspect this element.

inspect element

The source code that is used looks like this:

inspect element variable maps website link

To retrieve the href value of our link we could create a Dom Element variable.

variable maps website link

When we click the link we could retrieve the variable value in our preview mode. We are going to use this variable to activate our trigger.


Create a new trigger based on a Click. Choose Just links instead of All Elements. When our Maps website link variable is not null we fire our trigger.

trigger external link click google maps

Use this trigger to activate the desired tag.

test outbound link click google maps

Good luck!


Was it interesting? Share it, so someone else can read this too!Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *