Build your integration
This page lists what you build to connect a shop to Releva, in the order to build it. Each step links to the page with the details. If your shop runs on a platform with a Releva app or plugin, step 2 does most of the work for you.
The minimum that makes Releva work
Section titled “The minimum that makes Releva work”Releva’s recommendations and personalization need four things. Build them first:
- The base
Releva.push()call on every page of your storefront: who the visitor is and what is in their cart. product.idon product pages, in the same call.- Your products, sent to Releva and kept current.
- Your paid orders, sent to Releva.
On a platform with a Releva app or plugin, installing it covers the browser part. On a custom website, you build all four. Everything else on this page improves results but is not needed to go live. One exception: if data protection law applies to your shop, handle consent (step 4) before you go live.
1. Get your keys
Section titled “1. Get your keys”Every shop has two keys on Settings › Shop & Integration, on the General tab:
- The Access Token identifies your shop in the browser and in apps. It appears in your page source by design.
- The Secret Key authenticates your server’s calls. Keep it on your server only.
Mixing up the two keys is the most common integration error. Both are UUIDs, so they look alike.
- Find your Access Token and Secret Key
- Authentication, errors and limits: the base URL, how to send each key, status codes and the 800 KB body limit.
- How Releva connects to your shop
2. Install Releva on your platform
Section titled “2. Install Releva on your platform”Pick your platform. Each page covers the install, what the app or plugin sends, and a check at the end.
- Store platforms: Shopify, OpenCart, PrestaShop, WooCommerce, Magento 2, Magento 1 and MerchantPro.
- Regional platforms: CloudCart, CS-Cart and GombaShop or Shopiko.
- A shop on your own stack: Connect your custom website, with the JavaScript SDK reference.
- A mobile app: Mobile SDKs overview.
Install Releva only once per page. Do not add the JavaScript snippet by hand on a shop where a Releva app or plugin already loads it.
3. Send your catalog and orders
Section titled “3. Send your catalog and orders”These calls run on your server with the Secret Key. Check your platform’s page first: an app or plugin may already send some of them. The product ids you send here must be the same ids your storefront sends in product.id and in the cart. That is what ties browsing to your catalog.
| Call | When you call it | Needed? |
|---|---|---|
| Create or update products | Whenever a product changes: price, stock, name or custom fields | Required |
| Report paid orders | When an order is paid | Required |
| Let Releva pull your catalog | An endpoint you build. Releva calls it on a schedule to read your whole catalog and repair anything a missed update left stale. | Recommended |
| Report refunds | When an order is refunded | If you take refunds |
| Update product availability | When only a product’s availability changes | Optional |
| Delete a product | When a product is gone for good | Optional |
| Send order status updates | When an order’s status changes in your shop | Optional |
4. Handle consent and subscriptions
Section titled “4. Handle consent and subscriptions”Build the parts that apply to your shop:
- Tracking consent. If data protection law applies, pass your visitor’s consent state to the SDK. See Pass your consent state.
- Marketing subscriptions. If you send e-mail or text messages with Releva, tell Releva when a customer opts in or out. Start with Choose a consent call, then:
- Subscribe a customer from your server.
- Subscribe from the browser for a sign-up form on your storefront.
- Set up double opt-in if customers must confirm by e-mail.
- Unsubscribe a customer when they opt out in your systems.
- Registrations. Call Record a registration when a customer creates an account.
5. Check that it works
Section titled “5. Check that it works”- Open a page of your shop with your browser’s developer tools on the Network tab, filtered to
push. Each page sends onePOSTtohttps://releva.ai/api/v0/push/followed by your Access Token, and it answers200. - Follow Check that your store data arrives to find your page views, products and customers in the Releva admin.
- For a mobile app, follow Check that your mobile app is connected.
When the checks pass, Releva has what it needs. Next, you can send events that are specific to your business with Send custom events.