Custom code to suppress PII from Activity Map
I'm tasked with creating a Rule to track the number of instances an email link is clicked, i.e. <a href=malto:somemail@domain.com>somemail@domain.com</a>. Creating a rule is easy enough but this is PII and the issue is that the email address is PII and it must not be collected into any variables including out of the box Activity Map (Activity Map Link) and ClickMap (Object ID) variables.
After some research, I was able to successfully suppress them by adding this to the Custom Code in the Analytics Extension in Data Collection:
s.ActivityMap.regionExclusions = '"element_id';
Where element_id is the ID of the element container such as div or section or span that contains the email link. Again, this works perfectly and the Rule fires but the email address is nowhere to be found on the hit variables.
The issue is that the IDs are inconsistent. I happened to find them by testing and looking at the debugger. But what if there are other IDs I did not add in the exclusion list? This solution falls apart. I will always need the full list of IDs to exclude, which is cumbersome.
QUESTION: Is there a way to evaluate the link and look for the @ character. If there's an @ in the link, it's likely an email address. Therefore if it's an email address, suppress it from being collected in Activity Map and Click Map. By doing this I will not rely on knowing all the IDs to exclude and instead check on the fly if it's an email address that was clicked and if so suppress it.
