File DA-027 View as Markdown

How integrations work

This page lists every tool Double Agent sends its labels to, what each one receives and which consent it needs. Read it when you want to filter bots and agents out of your analytics, ad conversions or email lists.

Nothing to set up for most tools

The script looks for each tool on the page. When it finds one, it sends the verdict to it in that tool's own format. You don't add code. If GA4 and Meta Pixel are on your site, both start getting da_class and the other fields on the next page load.

Every tool gets the same nine fields: da_class, da_agent, da_score, da_bucket, da_rec, da_verified, da_behavior, da_behavior_risk and da_authorization. Their values are on Verdict.

Tools that take events get da_classified once per session, when the first verdict lands. A second event, da_final, is kept for a final verdict from the server. That needs the Handler, which is off today, so expect only da_classified for now.

The built-in tools

ToolFound when the page hasWhat it getsConsentPage
GA4gtag() or a gtag/js?id=G- scriptUser properties and the da_classified eventanalyticsGA4
Google Tag ManagerThe GTM containerA dataLayer push with the event and nine fieldsanalyticsGTM
Meta Pixelfbq()DoubleAgentClassified custom event; bot conversions held backadsAd platforms
TikTok PixelttqDoubleAgentClassified event; bot conversions held backadsAd platforms
Google AdsA gtag/js?id=AW- or googleadservices.com script, or gtag('config', 'AW-…')Nothing sent; bot conversions held backadsAd platforms
Shopifywindow.ShopifyCart attributes and Shopify.analytics eventsfunctionalShopify
Stripewindow.StripeNothing in the browser; you pass a token on your serverfunctionalStripe
MixpanelmixpanelSuper properties, and people properties after identify()analyticsMixpanel
Segmentanalytics.addSourceMiddlewarecontext.doubleagent on every event, and identifyanalyticsSegment
PostHogposthogEvent properties, and person properties once the visitor is identifiedanalyticsPostHog
AmplitudeamplitudeUser propertiesanalyticsAmplitude
Klaviyoklaviyo, _learnq or a static.klaviyo.com scriptProfile propertiesadsKlaviyo
MailchimpA form posting to list-manage.comA hidden DACLASS fieldadsMailchimp
HubSpot_hsq or a HubSpot tracking scriptContact propertiesanalyticsHubSpot
IntercomIntercom()User attributes through Intercom('update')analyticsnone
Microsoft Clarityclarity()One custom tag per fieldanalyticsnone
Hotjarhj()Events da_<class> (for example da_bot) and da_behavior_<label>analyticsnone

Intercom, Clarity and Hotjar need no setup in the tool. Filter recordings or users on the tag or event: in Clarity, the da_class custom tag; in Hotjar, the da_bot or da_agent event; in Intercom, the da_class user attribute.

Each tool belongs to a consent category, and the script reads your consent banner before it sends anything:

  • analytics: sent when the visitor allowed analytics (Google Consent Mode analytics_storage, OneTrust group

C0002, Cookiebot statistics, or Shopify's customer privacy API).

  • ads: sent when the visitor allowed advertising (ad_storage and ad_user_data, OneTrust C0004, Cookiebot

marketing). Klaviyo and Mailchimp are in this group because they feed marketing lists.

  • functional: sent with analytics consent, or always when the script runs with mode: 'security'.

With no banner on the page, every category counts as allowed. Holding back ad conversions from bots is not tracking, so it runs whatever the consent. More on consent: Privacy and consent.

Choose which tools run

By default every tool the script finds gets the fields. To pick them yourself, pass integrations in a queued init. Only the tools you list run:

doubleagent.push('init', { integrations: { ga4: { trafficType: true }, meta: true, hubspot: true } });

true turns a tool on. An object turns it on with options: ga4 takes trafficType, hubspot takes eventName. The names are ga4, gtm, meta, tiktok, gads, shopify, stripe, mixpanel, segment, posthog, amplitude, klaviyo, mailchimp, hubspot, intercom, clarity and hotjar. For a tool not on this list, write a plugin: Plugins.

Keep bots out of ad numbers

Meta, TikTok and Google Ads conversions are held back for confident bots. The rules and the setting are on Meta, TikTok and Google Ads.

When a verdict changes later

The browser sends what it knows on the page. When the server later settles a different label, it can correct GA4, Mixpanel, Klaviyo, Shopify orders and Stripe payments itself, with credentials you give it. See Relabel.

Next: set up the tool you use most, for example GA4 or Meta, TikTok and Google Ads.