onBeforeLinkClickSend

IMPORTANT
This callback is deprecated. Use 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.

WARNING
This callback allows the use of custom code. If any code that you include in the callback throws an uncaught exception, processing for the event halts. Data is not sent to Adobe.

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 filterClickDetails executes; onBeforeLinkClickSend does not.
  • Event grouping clickCollection.eventGroupingEnabled does not work.
recommendation-more-help
1ae86b30-e55e-49c1-ab11-9d0356a5f3e1