Define custom rules using filters

Filters let you define rules for a variety of actions including which conversions are reported.

Published on Updated on

Filters are custom fields you can create and set in your registration header. Filters are flexible and have more uses than we will cover here, but here are just two ways they can be useful:

  • Only count conversions for a specific product category, and filter out conversions for other categories.
  • Choose trigger data based on source event data because for event-level reports, the bit limit for the trigger data is different depending on the source type—ad click (0-7) or view (0 or 1). It can be convenient to dynamically assign the value of the trigger data depending on the source type.

How to declare filters

On source registration, add a filter_data field to the Attribution-Reporting-Register-Source header.

On trigger registration, add a filters field to the Attribution-Reporting-Register-Trigger header.

Example code

Updated on Improve article

This site uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. Learn more about our use of cookies.