Skip to main content
Level 2
August 15, 2023
Solved

Track Google Maps API interactions/clicks in Adobe Analytics

Hi, 

I am trying to understand whether or not I can track clicks/interactions with a the Google Maps API. Specifically, I am looking at the JavaScript API.

 

Hopefully this is possible - does anyone have experience using data collection to capture click/interactions with this kind of element? We would be hoping to view these clicks in Adobe Analytics as an event or evar.

 

Thank you!

SSampsa
SSampsaAccepted solution
Level 4
February 26, 2025

Interesting challenge, it has been a while since I looked at the Map API, but I suspected it has a similar way of getting events as Youtube's API does.

Based on their documentation, you can listen to events and then build tracking on those event listeners: Data Layer  |  Maps JavaScript API  |  Google for Developers

As an overly simplified example (I use Adobe Tags in my example, but direct integrations with e.g. s.tl-function would work just as well):

map.data.addListener('click', function(event) {
let customData = {};
// Populate custom data here from Google's event-object,
// which allows assigning data directly to either Tags or Analytics call
// without having to go through setVar/getVar or having to set them in s-object _satellite.track('map click', customData); });

I hope this helps 🙂

2 replies

kautuk_sahni
Adobe Employee
Adobe Employee
February 26, 2025

@dhaneshsh2 @_andy_ @ssampsa @itsme_ssj @dwright-adobe @john_man @abhinavbalooni @subeaep @meitmedia @jennifer_andrews Would appreciate it if you could check out this question and share any insights you might have!

Translate
Kautuk Sahni
SSampsa
SSampsaAccepted solution
Level 4
February 26, 2025

Interesting challenge, it has been a while since I looked at the Map API, but I suspected it has a similar way of getting events as Youtube's API does.

Based on their documentation, you can listen to events and then build tracking on those event listeners: Data Layer  |  Maps JavaScript API  |  Google for Developers

As an overly simplified example (I use Adobe Tags in my example, but direct integrations with e.g. s.tl-function would work just as well):

map.data.addListener('click', function(event) {
let customData = {};
// Populate custom data here from Google's event-object,
// which allows assigning data directly to either Tags or Analytics call
// without having to go through setVar/getVar or having to set them in s-object _satellite.track('map click', customData); });

I hope this helps 🙂

Translate