Concepts in plain words
Last changed
The ideas behind recapi's calls and dashboard, one section each.
In short
- A placement is one row of recommendations on your site; its list kind (For you, Similar products, Bought together, Trending) is picked on the dashboard.
- An event tells recapi a visitor acted on an item, from a view (3) to a purchase (10).
- Each visitor's history travels with each call, so the next list reflects the last click.
- Clicks and purchases are credited to the list that led to them; the lift test compares those lists with plain popular items.
- In the browser nothing is stored until the visitor consents; your cookie banner tool gets a ready entry for recapi.
flowchart LR
V[Visitor] -->|events: view, cart, purchase| R[recapi]
R -->|a list for a placement| P[Your page]
P -->|click on a listed item| C[Credited to the list]
C --> L[Lift test: lists vs popular items]
Placements and list kinds
A placement is one row: the home page, a product page, the cart. Each call names it as placement; without one, the
call uses the placement named default. Name rules: lowercase letters, digits, _ and -, up to 64 characters.
| List kind | What it shows | What the call sends |
|---|---|---|
| For you | Picked for each visitor from what they viewed and bought | the visitor's id or history |
| Similar products | Items like the product on screen | the product as context_item_id |
| Bought together | What shoppers carted or bought with the product on screen or in the cart | the product as context_item_id, or nothing on a cart page |
| Trending | Items more visitors are opening right now than usual | nothing extra |
You pick the kind per placement on the dashboard's Lists on your site page. Every listed item carries a why, a
reason safe to show anyone: the codes and a label for each are in the API reference.
Names you didn't set up
A call for a placement name you never set up still works: it gets the default placement's settings, and joins a lift
test running on default. The Lists on your site page names the default row after them: its settings are theirs.
The platforms' rows
Our platform integrations name each row by where it is, so the dashboard calls it by the first column:
| Row | WooCommerce plugin | Shopify snippet | Magento module |
|---|---|---|---|
| Product page | product |
product |
product |
| Cart page | cart |
cart |
cart |
| Other pages | shortcode (the [recapi] shortcode) |
section (a Custom Liquid section) |
block (the row's block in a layout) |
Each of these rows asks recapi only for the 4 products it shows, so a product counts as shown only when the row had room for it.
A product page the browser brings back with Back or Forward counts the product's view again, on these rows and with
the site tag's recapi.track('view'). The row keeps its cards, and a list is still counted as viewed once.
A product opened earlier
On a shop whose visitors come back to what they looked at, each list's first card is something this shopper left half an hour ago or more and has not bought. The platforms' rows mark it "You looked at this", in your page's language.
- recapi turns it on from your own visits, at each training. A small shop gets it once its visitors start coming back. There is nothing to set.
- It needs the visitor's history, so their consent. Rows with their own list kind, such as Bought together, don't have it.
- If your server sends the orders, let the browser know on the order's page (
trackwithsend: falsein the JavaScript library): else the card may be a product just bought. Our WooCommerce plugin and Magento module do it.
Several rows on one page
A page with several rows can ask for up to 10 lists in one call, billed as one. An item then appears on one row only, so put the most important row first (the API reference).
Events and levels
An event says a visitor did something with an item, at a level from 0 to 10. The libraries take names for the three a shop uses most.
| Level | Name in the libraries | Meaning |
|---|---|---|
| 0 | shown only: not used for learning | |
| 3 | 'view' |
opened the item (a click on a recommendation counts as one) |
| 5 | 'cart' |
added to cart |
| 10 | 'purchase' |
bought |
- Levels 1, 2 and 4 are for milder interest, such as a quick view or a bookmark. A site that isn't a shop maps its own actions onto the same scale: an article read to the end can be 5 (interaction levels).
- Send a click as a view (3), not as 5. The dashboard counts events at the conversion level and above as conversions (5 by default, Settings → What counts as a success), so a click sent as 5 would count as a conversion too.
- A negative level (
'reject'in the libraries) means "not interested": recapi never shows that visitor the item again until they act on it again. Send it only from a real "not interested" control, never for a skip or a bounce (rejections). - An event naming an unknown item id creates the item, with no tags. Describe your items (the items calls, or your platform's sync) to give them names, pictures, prices and tags.
Visitors and history
recapi knows a visitor by one of two ids, and remembers what they did.
| Id | What it is |
|---|---|
anon_id |
an anonymous id for one browser or device, created by the browser library once the visitor consented |
user_id |
your own id for a logged-in customer |
- When a visitor logs in, call
identify(userId): what they did before keeps counting, because it is the same person. On logout, callreset(): the library forgets the user, their history and the click credits, and starts a new anonymous id (quick start). - Items already in a visitor's history are left out of their lists, unless Settings allows repeats (troubleshooting).
Where the history is kept
- On the device. The library keeps up to 50 items the visitor acted on, each scored by its level and fading by half every 7 days, plus the 20 most recent items in order and up to 200 items they rejected. It sends this with each call, so a list reflects the click made a second ago.
- On recapi. recapi also keeps a history from the events it stores, for up to 90 days. When your server asks
with its secret key, a
user_idand no history, recapi uses its own, which helps a customer on a new device. A public key never gets lists from it (why). Turn this off in Settings (Remember signed-in visitors across devices, on calls from your server).
New items
A new item has no clicks yet, so recapi sets aside a few positions in longer lists for new or rarely shown items, and learns from how they do.
- Each placement has a Discovery level from 0 to 1, 0.3 unless you set one. On the Lists on your site page it is Off, Some or More (0, 0.3, 0.6), under a row's Change, then Advanced.
- At 0.3, a list of 10 gives one position to such an item (position 5). Position 1 always stays personalised.
- At 0.3, a list under 8, such as a row of 4, keeps no such position: all its items are chosen for the visitor. At More, a row of 4 gives position 2.
- An item counts as new for 72 hours after it is published or first seen, and for its first 500 times shown.
- Tags help: a new item starts like an average item of its tags until it has its own clicks.
- Discovery also lowers popular items a little, so the same bestsellers don't fill every row.
- A Bought together or Trending row works at discovery 0: no positions go to new items there.
These items carry why new or explore.
Our page reader
On a site without a shop platform, Recapi opens the product pages your visitors view, once a day each, to
draw their cards. It reads the product markup search engines read; a page without any gets a card with its
title and picture only, no price. Only the address you confirm in Settings, at most one page a second and 2,000 a day, however many accounts name your site. It names itself
recapi-page-reader with a link here and follows your robots.txt. To stop it, press "Stop reading my pages" in
Settings. What it reads: the website guide.
Allow our page reader
If your firewall or robots.txt keeps our reader out, your Quick start says so. Our reader calls only from:
| Address |
|---|
2.31.69.250 |
- On Cloudflare, add an IP Access rule that allows each address: a rule on the user agent can't skip Bot Fight Mode.
- In robots.txt, our reader follows its own group, else the
*one:
User-agent: recapi-page-reader
Allow: /
- A sold-out or removed page loses its card at once. Any other page keeps its card 7 days after the last read that found its product: one your robots.txt disallows, or a site that stays down.
- If your robots.txt answers with a server error or not at all, we read no page and try again after an hour, then less often, at least once a day. A missing robots.txt lets us read every page.
Attribution
The dashboard credits clicks and purchases to the list that led to them, through the list's recommendation_id: an
event that carries it counts for that list. The libraries add the id for you.
| After… | The item's events carry the id for | And |
|---|---|---|
| a list shows an item | 30 minutes | the first event above level 0 is the click |
| a click | 24 hours | later events (add to cart, purchase) count for the list |
- The click need not be on the list: a visitor who opens the item from a menu, a search or its address within those 30 minutes counts too. This is why the dashboard says Viewed after shown, not "clicked".
- A conversion counts only on an item the visitor clicked first, once an event on it reaches what counts as a success in Settings. An add to cart straight from the row counts as the click too.
- Home's Orders after clicks counts the orders these credited purchases belong to, each once.
- An event sent without an id still counts for the latest list that showed that item to that visitor in the 30 minutes before. An item nobody clicked within 30 minutes was found some other way.
When nothing is credited
- A library's popular fallback (recapi slow or out of reach) has no id, so nothing on it is credited.
- Without consent, the browser library keeps the credits for the current page only: on a site where a click loads a new page, pass the id in the link yourself (quick start).
The lift test
The lift test asks one question: do recapi's lists get more clicks and purchases than a list of your popular items would? For two weeks, a share of your visitors sees popular items in the placement instead; every visitor stays in their group.
- Start it with one click: Start the lift test on Home, or under Measure the lift on the quick start. The button appears once recapi has trained on 1,000 of your events; until then the Lift card, under Home's Details, says how many so far.
- recapi sizes the share to your traffic: 20% of visitors, or 50% below 20,000 users a day shown a list.
- Run it 14 days at least, even once a verdict shows: two full weeks even out weekdays and the novelty of a change.
Reading the result
Home's first sentence gives the verdict. Its Lift card, under Details, shows two figures, Viewed after shown, vs popular and Conversion, vs popular. A lift of +12% means recapi's lists are viewed after being shown 12% more often than the popular ones. Under each figure is the range the true lift lies in with 95% confidence. It is safe to check every day.
| Verdict | Meaning |
|---|---|
| Not enough data yet | each group needs at least 1,000 lists shown and 30 clicks (30 conversions for the conversion figure). The card estimates how many days a 20% gain in clicks would take to show at your traffic. |
| No clear difference yet | the two get clicks at rates too close to call. Keep the test running. |
| Trustworthy | the whole range is above zero ("recapi's lists get more clicks than popular ones") or below it ("check the list's settings"). |
| Can't be trusted | visitors didn't split as the test's settings say: usually a page cache serving a stored list, bots, or an integration that treats some visitors differently. Fix the cause and start a new test. |
When your traffic is too small for a verdict within 90 days, Home links to a choice on the test's page: stop it so all your visitors get recapi's lists, or keep it running. You can start a new test later.
Both groups are credited by the same rule (attribution). Popular items are more often opened another way, from a bestseller page or a menu, so that rule favours the popular group rather than recapi's.
When your purchase events carry what the buyer paid (value and currency), a second reading follows the verdict:
what each group's visitors spent on average, and how far apart, with a range. It counts all their purchases once the
test showed them a list, so lists that win clicks by moving buyers to cheaper products show there. It needs about
twice the visitors of the conversion figure, its range holds on the day you read it (not every day, as the verdict's
does), and it never changes the verdict. Judge it once, at the end of the test, and never stop a test on it.
For other comparisons, such as two list kinds, create a test on the Tests page. Its list gives each test's result in the same words as the test's own page.
Variety
Variety keeps a list from showing ten near-identical items. Set it per placement on the Lists on your site page as
Off, Some or More (0, 0.3 and 0.6 of the API's 0 to 1), or Same as default: the default row's variety,
which every row without its own takes.
- 0 keeps the list focused on the best matches.
- Higher values move items that share tags with the items above them further down the list.
- It works on the tags you send with
PUT /v1/items, so an item without tags keeps its place. The Lists on your site page says how many of your active items have no tag.
Settings
What each option of the dashboard's Settings changes in the calls.
| Option | What it changes |
|---|---|
| Remember signed-in visitors across devices, on calls from your server | recapi fills in its own history for a user_id your server sends without one, with its secret key (where the history is kept); off, GET /v1/users/{id}/history answers empty too |
| Recommend products a visitor already opened or bought | items in the visitor's history may come back in their lists (music, games, re-orders); off, they come back only to fill a row nothing else fills, as on a shop of a few products |
| Only recommend products you have sent us | items known only from events wait, inactive, for the items calls to describe them, so a public key cannot add recommendable items (new items) |
| What counts as a success | the conversion level: 3, 5 (the default) or 10 (events and levels); a level set through the API shows as its own choice |
Settings' People fold gives your developer a login of their own: type their address, and they choose a password. All logins have the same rights, billing included, and nobody can remove the one that signed up.
Consent
In the EU, storing data on a visitor's device generally needs their consent, and a recommendation history usually does. So the browser library stores nothing until you tell it the visitor agreed.
- Create the client with
consent: false(the default), then callsetConsent(true)from your cookie banner when the visitor accepts. A site that needs no banner passesconsent: true. - Without consent, the library reads and writes no storage and creates no anonymous id. The history lives in memory
for the current page. Events are still sent, without an
anon_id. - Such an event may name the product page the visitor came from on the same shop (
context_item_id, read from the browser's address of the page before; the Shopify, WooCommerce and Magento integrations send it). It cannot be tied to a person, a device or another visit. Search results, cart, checkout, order and account pages never go. - Withdrawing consent deletes what was stored.
- When the browser sends Do Not Track or Global Privacy Control, the library follows nobody: it sends no events and
stores nothing, and
setConsent(true)doesn't lift it. Lists still work, as popular, trending or similar items.
The Shopify, WooCommerce and Magento integrations pass your banner's answer to the library for you. To erase a customer's data, make one call from your server with your secret key (quick start).
Cookie banners
Your cookie banner tool lists what recapi stores. Paste this entry so it shows as known, not unclassified. Provider: recapi. Category: Statistics, the consent our WooCommerce plugin reads (Shopify calls it Analytics).
| Name | Type | Purpose | Expiry |
|---|---|---|---|
recapi:v1: + your shop's code |
local storage | personalise | no expiry |
recapi |
cookie | credit orders | 1 day |
recapi:own |
local storage | leave your own visits out | until you count them again |
recapi_own |
cookie | leave your own test orders out | 1 year |
The item remembers recent views to personalise the row; the cookie credits an order to the row that led to it. Both are written on your own domain, and only after the visitor consents. The cookie is set only by WooCommerce with a secret key, and by Magento. Your tool's scan shows your shop's code.
recapi:own is written only in your own browser, when you open your shop with the quick start's link or, on
WooCommerce and Magento, your shop's admin: your visits and test orders are then left out of your numbers. The
recapi_own cookie copies it for the orders WooCommerce and Magento send.
recapi stores nothing for a shopper before consent and nothing under Do Not Track, sets no cookie on its own domain, and deletes the first two lines when consent is withdrawn.
What two tools did on a test WooCommerce shop (Complianz 7.5.8, CookieYes 3.5.10): the row showed before consent, and nothing was stored until the visitor accepted.
| Tool | Lists recapi as | Blocks recapi's script |
|---|---|---|
| Complianz | unknown, after its online scan | no, only known services and your rules |
| CookieYes | uncategorised, after its web app's scan | no, only scripts matching a blocked entry |
Keeping the row for visitors who decline
The row works without consent. Blocking recapi's script only hides it from visitors who decline.
Exempt the script only when your banner's answer reaches recapi, so recapi itself waits for consent:
- WooCommerce: the consent answer is the WP Consent API or another banner, not "no cookie banner".
- Magento: Cookie Restriction Mode is on.
- Shopify: your banner feeds Shopify's customer privacy settings.
- Your own site: the client starts with
consent: false, and your banner callssetConsent(true).
Otherwise the exempted script stores before the visitor answers: keep it blocked.
| Tool | Keep the script running |
|---|---|
| Cookiebot | data-cookieconsent="ignore" on recapi's script tag (Cookiebot) |
| OneTrust | nothing for an inline tag, as the quick start's; data-ot-ignore on one with a src (OneTrust) |
| Complianz | delete your rule, or whitelist the script (Complianz) |
| CookieYes | leave the entry's script pattern empty (CookieYes) |
On WooCommerce and Magento there is nothing to add: the plugins print Cookiebot's attribute whenever recapi waits for consent, and their tag is inline.