onBeforeLinkClickSend
clickCollection.filterClickDetails instead.The onBeforeLinkClickSend callback allows you to register a JavaScript function that can alter link tracking data you send just before that data is sent to Adobe. It allows you to manipulate the xdm or data object, including the ability to add, edit, or remove elements. You can also conditionally cancel the sending of data altogether, such as with detected client-side bot traffic.
This callback only runs if clickCollectionEnabled is enabled and filterClickDetails does not contain a registered function.
If onBeforeEventSend and onBeforeLinkClickSend both contain registered functions, onBeforeLinkClickSend is executed first.
onBeforeLinkClickSend and filterClickDetails
The clickCollection.filterClickDetails callback is designed to replace onBeforeLinkClickSend. Adobe strongly advises against assigning callback functions to both simultaneously. If you assign a callback function to both filterClickDetails and onBeforeLinkClickSend, the library uses the following logic:
- Only
filterClickDetailsexecutes;onBeforeLinkClickSenddoes not. - Event grouping
clickCollection.eventGroupingEnableddoes not work.