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!
Solved! Go to Solution.
Views
Replies
Total Likes
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
@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!
Views
Replies
Total Likes
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
Views
Like
Replies
Views
Likes
Replies