Expand my Community achievements bar.

SOLVED

eventGroupingEnabled - web sdk activity map

Avatar

Level 3

hi all, based on the adobe documentation clickCollection.eventGroupingEnabled is a boolean that determines if the library waits until the next page to send link tracking data (clickCollection | Adobe Data Collection). Have tried setting it to "true" and the event bundling does not work. The existing appMeasurement set up does the trick - activity map is being surfaced on the next pageload. Want to have the exact set up in the web sdk. Would appreciate if anyone could help. Thanks  

 

activity map.JPG

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi @Franc_G 

little update on this one. So, I looked at the alloy.js code which has a function hasPageName that internally called in onBeforeEvent and expects xdm.web.webPageDetails.name to be set to detect page views. Also mentions that ideally, the event type should be "web.webpagedetails.pageViews" (which is commented and not in use).

 

Both is a little problematic in my opinion since these days, you are not obliged to set these values to have a working analytics solution if you use WebSDK UX to set data variables instead of going for an XDM schema.

 

bjoern__koth_0-1724609215147.png

bjoern__koth_1-1724609254310.png

Long story, it still does not work for me though

 

Sent it to support, maybe they have an idea. But maybe worth checking if you can make it work on your end

View solution in original post

8 Replies

Avatar

Level 10

Hi @Franc_G 

 

yeah, it does not seem to work for me either. I actually have a call tomorrow 11:30am CEST with Adobe support about this

Send me a DM if you want to hop on the call.

 

Björn

Avatar

Correct answer by
Level 10

Hi @Franc_G 

little update on this one. So, I looked at the alloy.js code which has a function hasPageName that internally called in onBeforeEvent and expects xdm.web.webPageDetails.name to be set to detect page views. Also mentions that ideally, the event type should be "web.webpagedetails.pageViews" (which is commented and not in use).

 

Both is a little problematic in my opinion since these days, you are not obliged to set these values to have a working analytics solution if you use WebSDK UX to set data variables instead of going for an XDM schema.

 

bjoern__koth_0-1724609215147.png

bjoern__koth_1-1724609254310.png

Long story, it still does not work for me though

 

Sent it to support, maybe they have an idea. But maybe worth checking if you can make it work on your end

Avatar

Level 3

@bjoern__koth  a bit of a tricky one. I will raise a ticket with Adobe - this is what our customer support has suggested.  

In the current setup (without event grouping), the activity map is not amazing. It will results in an enormous amount of extra requests. Any nav link, toolbar, tab will result in an additional server request.  Adobe needs to sort this out. I can see a lot of clients being unhappy once they see the server request quota limits being breached.

Putting this on hold for now.

Avatar

Level 10

I mean it should not be rocket science. You can persist the data yourself in the WebSDK's "Edit filter click properties callback code" and can abort the execution with "return false" if needed.

 

try {
    // persist the data in sessionStorage
    const payload = {
        link: encodeURIComponent(content.linkName),
        page: encodeURIComponent(content.pageName),
        region: encodeURIComponent(content.linkRegion),
        pageIDType: content.pageName ? 1 : 0,
    };
    sessionStorage.setItem("prev_activityMap", JSON.stringify(payload));

    // abort execution
    return false;

} catch (error) {
    _satellite.logger.error(">>> ActivityMap - filterClickDetails error", error);
}

 

 

And from there on, in the page view, we will have to pull it out and set it on the data.__adobe.analytics.contextData.a.activityMap object

bjoern__koth_0-1724851010852.png

 

In my case, I use an "Update variable" WebSDK action's custom code block.

bjoern__koth_0-1724852971556.png

 

 

// try to read previous ActivityMap item from sessionStorage
try {
    let prev_activityMap = JSON.parse(sessionStorage.getItem("prev_activityMap"));

    if (Object.keys(prev_activityMap).length > 0) {
        content.__adobe.analytics.contextData = content.__adobe.analytics.contextData || {};
        content.__adobe.analytics.contextData.a = content.__adobe.analytics.contextData.a || {};
        content.__adobe.analytics.contextData.a.activitymap = content.__adobe.analytics.contextData.a.activitymap || {};

        // iterate over sessionStorage item and fill activitymap context data
        for (const [key, value] of Object.entries(prev_activityMap)) {
            content.__adobe.analytics.contextData.a.activitymap[key] = decodeURIComponent(value);
        }

        // remove sessionStorage item
        sessionStorage.removeItem("prev_activityMap");
        _satellite.logger.debug(">>> ActivityMap applied", content.__adobe.analytics.contextData.a.activitymap);
    }
} catch (error) {
    _satellite.logger.error(">>> ActivityMap - filterClickDetails error", error);
}

 

 

This seems to work on my end at least but again, should work out of the box.

bjoern__koth_1-1724853075428.png

 

Also, I do not really like that you can only capture that one event.

So, maybe a hybrid approach could be best. Meaning, we can check if the clicked link URL is actually navigating away on another page and if not, still trigger the activitymap right away to not lose interactions without page navigation?

 

Avatar

Level 3

@bjoern__koth  thanks for the above - definitely a valid back up option. I have raised a ticket with adobe customer support and their engineers are looking into it. Would really prefer for this to work out of the box, but its good to have a back up option

Weirdly enough, on my end, out of the box solution works on SPAs, but it does not work on non-SPA pages. But then again, I am using a different TMS (Ensighten and not Launch). 

Avatar

Level 10

Interesting, but could Ensighten have an older version of the WebSDK where it still works,

@Jennifer_Dungan mentioned that her approach suddenly stopped working. 

Avatar

Level 10

Hi @Franc_G 


had the session with support, they will look into the issue. According to the agent, he would also assume that the sessionStorage value is picked up upon and request on the next page.
He will investigate with the WebSDK team and come back to me next week.

Cheers