adobelaunchadobe-analytics

How to load Adobe Launch Tools after the User accepted cookie? (No Page Reload)


I have enabled "UE Compliance" on Adobe Launch to avoid triggering any analytics if the user has not accepted the Cookie Terms.

As soon as the user accepts the terms, a cookie is set, but the Adobe Launch library did not properly load, and the page needs to be re-loaded in order to start tracking.

I want to start tracking right after the user accepted the cookie, without refreshing the page.

Any hint is much appreciated.


Solution

  • I don't know what your code looks like that handles the terms/cookie setting, but ideally, you should trigger something for Launch to listen to, whenever the visitor accepts.

    For example, whenever the visitor accepts the terms, add the following to your code at the appropriate place (e.g. the code that actually sets the cookie, if the cookie value is to allow)

    _satellite.track("pageview_gdpr_accepted");

    Then in Launch, create a rule of Event Type Direct Call :

    enter image description here

    Alternatively, you can create and broadcast a javascript custom event, e.g.

    var event = new Event("pageview_gdpr_accepted");
    document.body.dispatchEvent(event);
    

    You should have this execute same as before (e.g. when the cookie with good value is set), and then in Launch, create a rule of Event Type Custom Event:

    enter image description here

    Note: If you go the Custom Event route, make sure you create/trigger on document.body or a decendant; Launch will not listen for custom events on document itself.

    If you are unable to add code to your site to explicitly trigger A Direct Call or Custom Event rule, another alternative is to create a Data Element that references the sat_track cookie:

    enter image description here

    Then make a rule of Event Type Data Element Change:

    enter image description here

    with a condition to check if the Data Element value is true:

    enter image description here