File DA-032 View as Markdown

Klaviyo

With Klaviyo on your site, each visitor's Klaviyo profile gets the da_* properties. Use them to keep bot sign-ups out of your flows and your send counts. Nothing to add in code.

What Klaviyo gets

klaviyo.identify({ da_class, da_agent, da_score, da_bucket, da_rec, da_verified, da_behavior, da_behavior_risk, da_authorization });

The script calls it when the verdict changes, and again when a visitor submits a Klaviyo form, because that is when an anonymous visitor becomes a profile. Klaviyo counts as marketing, so this needs ads consent (see consent). Field values: Verdict.

Keep bots out of flows

  1. In Klaviyo, go to Audience › Lists & segments › Create › Segment.
  2. Add the condition Properties about someone, da_class equals bot. Save it as Bots (Double Agent).
  3. In each flow's trigger settings, add the profile filter is not in segment Bots (Double Agent).

Check it worked

Submit a Klaviyo form on your site with a test email. Open that profile in Klaviyo: under Custom properties you should see da_class set to human.

Fix labels after the page

When the server's verdict differs from the browser's, the server can update the profile itself through Klaviyo's Profiles API. It only updates a profile Klaviyo already has, and never creates one. It looks for the profile in this order:

  1. Klaviyo's exchange id from the __kla_id cookie. Klaviyo sets it once a visitor is identified, for example after a form submit or a click from a Klaviyo email.
  2. The External ID. This works only if your site passes the same value to doubleagent.identify() as it sets as the profile's External ID in Klaviyo.

If neither finds a profile, nothing is sent. Add a private API key with Profiles: Full Access (the server reads the profile, then updates it) in Sites › your site › Settings › Server relabel credentials. See Relabel.

Next: Mailchimp or How integrations work.