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. |
Authentication is your Tenant ID in the BB-Tenant-Id header, the same as the storefront uses. You find it at the top of the 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.
- Quiz events from before the identify call are not sent to Klaviyo or Omnisend afterwards. A shopper identified at checkout does not trigger a "Quiz Completed" flow for an earlier anonymous quiz.
For the merchant view of this, see how bluebarry recognizes customers.