Date of slack thread: 4/15/24
Anonymous: Hi Support Team, I am looking to implement a feature gate that filters out specific traffic sources from an ongoing experiment on our platform. Specifically, we aim to exclude all traffic originating from Google Ads. Could you provide guidance or examples on how to best set up this feature gate? Any documentation or code snippets that would help in accurately identifying and filtering Google Ads traffic would be appreciated.
Anonymous: Google ad clicks will usually contain a query parameter utm_source=google
. You can use that to filter google ad traffic from your experiment. To achieve this, you can pass the page_url as a custom property in the user object.
const user = {
userID: 'some user id',
custom: {
page_url: window.location.href
}
}
And now in the targeting feature gate, you can have a rule like this: