Integration Filters

Overview

Integration Filters allow you to either allow or drop events based on a set of criteria you configure within the transformation.

How To Use Integration Filters

Integration Filters can only be accessed via download/upload functionality within a playbook. They are not configurable within Playbooks in the UI. For more information about downloading and uploading playbooks, see the Integration Transformations document.

Filters can be specified inside the “global”, “default”, or “eventSpecific” sections of the playbook.

Filter Actions

The most important concept to understand relating to Filters are Filter Actions. They determine whether events are dropped if they meet the filter criteria, or if an event can only be sent if it meets the filter criteria.

There are two Filter Actions:

  • allow: If the filter condition is true, allow the event to be sent to the destination. If the condition is not true, then the event will be dropped.
  • deny: If the filter condition is true, drop the event to prevent it from reaching the destination. If the condition is not true, the event will be sent to the destination.

It is very important to understand Filter Actions. If these are set incorrectly, they may allow data that should be filtered out of the stream to reach a destination, or they may result in data not reaching a destination when it should.

ByEventNames

Filtering using the ByEventNames methodology will allow you to filter events based on the name of the event.

{
  "byEventNames":  {
    "action":  "deny",
    "events":  [
      "ssn_sent",
      "credit_report_sent"
    ]
  }
}
// Drops events if their event name is equal to "ssn" or "credit_report". Otherwise, allows the event.

{
  "byEventNames":  {
    "action":  "allow",
    "events":  [
      "page",
      "screen"
    ]
  }
}
// Allows events if their event name is equal to "page" or "screen". Otherwise, drops the event.

ByConditions

Filtering using the byConditions methodology will allow you filter events based on the parameters that are located within events. These are the available byConditions filters:

Drop events when consent.C0004 is true

byConditions:
  action: deny
  when:
    booleanEqual:
      inputPath: consent.C0004
      value: true

Drop events when consent.C0004 is true, "true", "True", "TRUE", etc

byConditions:
  action: deny
  when:
    matchesAny:
      conditions:
        - booleanEqual:
            inputPath: consent.optOut.C0004
            value: true
        - stringEqual:
            ignoreCase: true
            inputPath: consent.optOut.C0004
            value: "true"

Allow events that have at least one product in the properties.products array (drop the rest)


byConditions:
  action: allow
  when:
    inputPathIsObject:
      inputPath: properties.products.0

Is inputPath a specific boolean value?

booleanEqual:
  inputPath: consents.C0004
  value: true

Is inputPath present?

inputPathExists:
  inputPath: properties.products.0

Is inputPath an array?

inputPathIsArray:
  inputPath: properties.products

Is inputPath a boolean?

inputPathIsBoolean:
  inputPath: context.active

Is inputPath a number?

inputPathIsNumber:
  inputPath: context.app.build

Is inputPath an object?

inputPathIsObject:
  inputPath: properties.products.0

Is inputPath a string?

inputPathIsString:
  inputPath: properties.products.0.sku

Is inputPath a specific string value?

stringEqual:
  inputPath: context.ip
  value: 127.0.0.1

Is inputPath a specific number value?

numberEqual:
  inputPath: properties.total
  value: 1000

Is inputPath not a specific number value?

numberNotEqual:
  inputPath: properties.total
  value: 1000

Is inputPath greater than a specific number value?

numberGreaterThan:
  inputPath: properties.total
  value: 1000

Is inputPath greater than or equal to a specific number value?

numberGreaterThanEqual:
  inputPath: properties.total
  value: 1000

Is inputPath less than a specific number value?

numberLessThan:
  inputPath: properties.total
  value: 1000

Is inputPath less than or equal to a specific number value?

numberLessThanEqual:
  inputPath: properties.total
  value: 1000

Does inputPath contain a specific string value?

stringContains:
  ignoreCase: true
  inputPath: context.userAgent
  value: mozilla

is inputPath a specific string value?

stringEqual:
  inputPath: context.ip
  value: 127.0.0.1

Is inputPath a specific string value? (case independent)

stringEqual:
  ignoreCase: true
  inputPath: context.properties.category
  value: games

Is inputPath not a specific string value? (case independent)

stringNotEqual:
  ignoreCase: true
  inputPath: context.properties.category
  value: games

Is inputPath not a specific string value? (case independent)

stringNotEqual:
  ignoreCase: true
  inputPath: context.properties.category
  value: games

Does inputPath start with a specific string value?

stringHasPrefix:
  ignoreCase: true
  inputPath: context.userAgent
  prefix: mozilla

Does inputPath end with a specific string value?

stringHasSuffix:
  inputPath: writeKey
  suffix: test