I have called ‘enableLinkClickTracking’ to send click events, but I’m wanting to selectively add a custom context for specific links.
The snowplow API provides a filter function, but I’m not wanting to disable specific link events, rather add extra context data to some.
My idea was to use custom context generator (as per this issue https://github.com/snowplow/snowplow-javascript-tracker/issues/372).
Something along the lines of this:
window.snowplow('enableLinkClickTracking', null, true, true,
[], // static contexts
function(args){
console.log('custom context');
// pseudo code, not actual code used
if(args data matches specific link) {
return [{custom: 'context'}];
}
return null;
});
However, it seems this ‘context generating function’ support only exists for ‘trackPageView’.
Is it possible to have this added, or is there an another way to do this?