Expand my Community achievements bar.

SOLVED

PII obfuscation for Activity map in WebSDK

Avatar

Level 1

Hi Analytics Community,

 

We have implemented the following code in with AppMeasurement and was wondering if someone can help with the equivalent of the same for WebSDK

 

// preserve the original function, e.g. for cases where the link is *not* an email link
s.ActivityMap.originalLink = s.ActivityMap.link;
s.ActivityMap.link = function(element, linkName) {
  if (element) {
    // check for mailto: protocol
    // alternatively, you can provide your own evaluation condition, e.g. using a regular expression to check for an email address
    if (element.protocol && element.protocol === 'mailto:') {
      // this is an email link
      return 'email link'; // this is the ActivityMap link name
    } else {
      // this isn't an email link
      // use ActivityMap's original function
      return s.ActivityMap.originalLink(element, linkName);
    }
  }
};

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

That's a very clever solution! Unfortunately, I haven't started working with WebSDK yet and am not sure how to adjust that...

 

I would assume that Adobe's standard "s_objectID" solution should continue to work with WebSDK...  unfortunately, this would mean needing to adjust source code (it may also impact other functionality if you have inline click actions on your site)....

https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/s-objectid.html?lang...

 

But, since this is also only triggered on a click, you could in theory run a small script on each page when it's loaded to append this onto your links where the href contains "mailto:"....  But if you have elements that could potentially appear after that (modal popups, JS loading new content into the page, etc) then this likely won't work....

 

I just exclude "mailto:" links from tracking in my solution right now.... 

 

Maybe someone else will have some suggestions?

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor and Adobe Champion

That's a very clever solution! Unfortunately, I haven't started working with WebSDK yet and am not sure how to adjust that...

 

I would assume that Adobe's standard "s_objectID" solution should continue to work with WebSDK...  unfortunately, this would mean needing to adjust source code (it may also impact other functionality if you have inline click actions on your site)....

https://experienceleague.adobe.com/docs/analytics/implementation/vars/page-vars/s-objectid.html?lang...

 

But, since this is also only triggered on a click, you could in theory run a small script on each page when it's loaded to append this onto your links where the href contains "mailto:"....  But if you have elements that could potentially appear after that (modal popups, JS loading new content into the page, etc) then this likely won't work....

 

I just exclude "mailto:" links from tracking in my solution right now.... 

 

Maybe someone else will have some suggestions?

Avatar

Level 1

@dwright Do you know whats the replacement object for s in the WebSDK? Since Activity Map was recently introduced to the WebSDK, I havent seen a relavent document to this problem statement. Could you help?