The Identify API attaches an email address to a visitor, so their earlier browsing, searches and quizzes join their customer profile. The Shopify, WooCommerce and Magento integrations already call it at checkout. Use it yourself on other stores, or after a login or newsletter sign-up.
From the storefront
On a page where the bluebarry script runs, one line is enough:
window.barry.identify({ email: "[email protected]" });The script adds the visitor id and, when there is one, the current quiz session. It does nothing when no email is given.
From your server
To call it from your backend, for example from an order webhook, you need the visitor id. Read it in the browser with window.barry.getUid() and pass it along with the order.
curl -X POST https://data.bluebarry.ai/data/identify \
-H "Content-Type: application/json" \
-H "BB-Tenant-Id: <your tenant id>" \
-d '{ "email": "[email protected]", "userId": "<visitor id>" }'| Field | Required | Meaning |
|---|---|---|
email | Yes | The shopper's email address, up to 256 characters. |
userId | Yes | The visitor id from window.barry.getUid(). |
sessionId | No | A quiz session id, when you have one. |
source | No | Where the email came from: account, order or checkout. It shows as the profile's Source in Studio. Without it, the Source is Identify call. |
Send your Tenant ID in the BB-Tenant-Id header. You find it at the top of the Store data → Integrations page. A successful call returns 204 No Content. An invalid email returns 400.
What happens
- bluebarry always creates or updates a profile for the visitor. They do not need to have taken a quiz. The call is skipped only when the visitor id is missing.
- An email the profile already has is never overwritten.
- The visitor's other records with the same email or visitor id are merged into one profile.
- An email from the identify call is not sent to Klaviyo or Omnisend, and neither are quiz events from before the call. Those tools only get shoppers who left their email or phone number in a quiz, a product check or a popup.
For the merchant view of this, see how bluebarry recognizes customers.