Expand my Community achievements bar.

Join us for the next Community Q&A Coffee Break on Tuesday April 23, 2024 with Eric Matisoff, Principal Evangelist, Analytics & Data Science, who will join us to discuss all the big news and announcements from Summit 2024!

Newbie question - how to track modal open|close|links

Avatar

Level 1

Hi there,

 

Ive never worked with AA before so apologies for the beginner question. Ive been tasked to track a modal but after reading online documentation and the blogs of implementation experts (Jim Gordon, etc) Im still very confused by the many different ways of doing it. Seems like theres eVars, eProps, events, rules, dataLayer, and no dataLayer so im trying to understand whats the correct combination of things or the best way of setting up the following:

 

I need to create a tagging spec for:

1 - CTA button to open a modal

2 - CTA button to close a modal

3 - While the modal is open, track clicks to a 'learn more' link

     In GA i track this as follows:

window.dataLayer = window.dataLayer || []; window.dataLayer.push({

   'event': 'trackEvent',

   'category': 'modal',

   'action': 'link click',

   'label': '[clicked text]', // 'learn more'

   'linkUrl': '[clicked url]', // 'example.com/text'

});

 

4 - While the modal is open, track clicks to items (similar to anchor links but they are not links) that have each a date and time.

    In GA i track this as follows:

window.dataLayer = window.dataLayer || []; window.dataLayer.push({

   'event': 'trackEvent',

   'category': 'modal',

   'action': 'click',

   'label': '[clicked text]', // '06/06/2020 - 13:00PM'

});

 

Im very familiar with Google Analytics, GTM, JavaScript and dataLayers but not with AA and Launch so anything helps.

 

Thanks!

Rafa

 

2 Replies

Avatar

Level 1

Hi Rafael

 

AA is more on the lines of GA4 tagging, it's more elaborate than just firing stuff into it and has to be thought through on the basis of reporting required than recording data. Also, we usually need to reduce tracking events by combining data to be passed where possible.

 

This can be done in many ways, a simplest way is:

Pass the value assetType+Name+event to the customLink value in custom link tracking. So it would be reported under custom link tracking report. Disadvantage is not many metrics are available for it. 

 

A more elaborate can be done in many ways, below is one of the way possible:

  • Use one eVar which stores asset name & Type, this could be a common one which stores modals, forms, accordions, pop-ups etc (like an event category but not actually that).
  • One event to record: open or start(forms)
  • Close: do we really need to record a close event(what's the advantage of it?) - If really required, could record both form submit and Close event in the same event.
  • Link Clicks leading to a page on the same site: pass the data to be tracked along with the next pageView.  

If pathing report is required then maybe create a prop and enable pathing for it and pass pageName (pageView event) to it and the assetType+Name+Event value in that same prop on the above events.   

 

So, for open:

Fire a custom link tracking with the pageName eVar(hope that's being done) and this asset eVar and event index used to record open.

Same with close.

 

Now, for linkClicks in the modal:

For links leading to a page on the same site; pass assetType+Name+Linktext to the same eVar along with the link pageView. 

For external links: Modify your externalLink click tracking to record assetType+Name+ext:Linktext in the same eVar. 

 

This is just one of the ways to do it, every reporting requirement will improvise the tracking methodology.

 

Adobe is way powerful than GA, just spend some time viewing the learning sessions or recordings on SDEC here:

https://rebrand.ly/2020-07-21-wp3ee

 

Cheers

Samrat Dsouza

Avatar

Level 1

Thank you Samrat, thats very helpful. I have a follow up question, what about tracking the items inside the modal that are NOT links. Should I set an event for those clicks tied to the modal eVar? or should i be using something else for those?

 

Following your helpful response this is what i understand but let me know if im not getting it right:

 

- eVar1 for the modal

- event1 for the open click

- event2 for the clicks to non link elements <-- any way to send the click text of these in the same event?

- event3 for link clicks to a 'learn more' cta <-- any way to send the page url (where the modal is located) in the same event?

 

...and thanks about SDEC, Im familiar with what Greco and with what the SD team are doing with this initiative. Very good stuff! Im checking out the vid.