Expand my Community achievements bar.

SOLVED

Track Google Maps API interactions/clicks in Adobe Analytics

Avatar

Level 2

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!

1 Accepted Solution

Avatar

Correct answer by
Level 4

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

View solution in original post

2 Replies

Avatar

Administrator

@dhanesh04s @_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!



Kautuk Sahni

Avatar

Correct answer by
Level 4

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