# Connect your OpenCart store

> Install the Releva module in OpenCart, paste your Access Token, Secret Key and page tokens, set the consent cookie, and check in Releva that page views, products and customers arrive.

The Releva module for OpenCart (extension **Releva**, package `Releva_Releva-x.y.z.ocmod.zip`) puts the Releva tracking snippet on your storefront pages, with a page token per page type, and serves the endpoints Releva reads your product catalog and newsletter subscribers from. You install it in the OpenCart admin and configure it with keys and tokens you copy from Releva. In Releva itself you create the shop with platform **OpenCart**, copy the keys and tokens, and later check that data arrives.

> **Note**
>
> The steps inside the OpenCart admin and their screenshots show OpenCart 3.0.3.8 with module 1.0.18. Other versions can look different. What the module sends to Releva, and when, is listed under [What syncs](https://releva.ai/documentation/integrations/opencart/connect-your-opencart-store/#what-syncs).

## Before you start

* A shop in Releva with **Platform** set to **OpenCart**. The platform is chosen on **Create Shop** and is read-only afterwards on **Settings › Shop & Integration › General**. Choosing it fills in the catalog, subscriber and unsubscribe URLs for you (see [In Releva: check the sync settings](https://releva.ai/documentation/integrations/opencart/connect-your-opencart-store/#4-in-releva-check-the-sync-settings)). If your shop was created as **Other / Custom**, ask your account manager for an OpenCart shop. See [How accounts, shops and billing work](https://releva.ai/documentation/learn/account/how-accounts-shops-and-billing-work/#creating-a-shop).
* The module zip from your Releva account manager.
* OpenCart 3.x, or 2.3 up to 3.0. For OpenCart 4, ask your account manager.
* An OpenCart admin user who may install extensions and modifications.
* Your shop runs on HTTPS and can reach `https://releva.ai` from its server. Releva calls your shop’s catalog and subscriber endpoints over HTTPS, and your server calls the Releva API.
* A Releva page for each page type you want to personalize (home, category, product, cart, checkout, search, specials). See [How product blocks work](https://releva.ai/documentation/learn/product-blocks/how-product-blocks-work/#pages-and-tokens).

## Install

### 1. Allow the installer to create folders (OpenCart 3 and 2.3)

OpenCart 3 does not let extensions create new folders during installation, so the Releva module cannot install until that restriction is lifted. Skip this step if you have already disabled the directory restriction for extension installation.

1. Go to **Extensions › Installer** and select **Upload**.

   ![OpenCart admin: Extension Installer with the Upload button highlighted](https://releva.ai/documentation/_astro/opencart-extension-installer-upload.D26CtXWC_vLjaf.webp) *Merchant platform (OpenCart admin).*

2. Upload the installer fix for your version: `fixoc3installer.ocmod.zip` for OpenCart 3, or `fixoc2installer.ocmod.xml` for OpenCart 2.3 up to 3.0. Ask your account manager for the file.

3. Go to **Extensions › Modifications** and select the refresh button in the top right. The fix appears in the list as **Fix opencart 3 installer folder limitation**.

   ![OpenCart admin: Modifications list with the installer fix and the refresh button highlighted](https://releva.ai/documentation/_astro/opencart-modifications-refresh-after-installer-fix.Buvsinil_16wY5W.webp) *Merchant platform (OpenCart admin). The fix is a third-party OCMOD by GeekoDev.*

### 2. Install the Releva module

1. Go to **Extensions › Installer** again and upload the Releva module zip.

   ![OpenCart admin: Extension Installer with the installer fix in the history and Upload highlighted](https://releva.ai/documentation/_astro/opencart-extension-installer-upload-releva-module.BFF37yj8_ZkUDA4.webp) *Merchant platform (OpenCart admin).*

2. Go to **Extensions › Modifications** and select the refresh button once more. **Releva integration** now appears in the list.

   ![OpenCart admin: Modifications list with Releva integration and the refresh button highlighted](https://releva.ai/documentation/_astro/opencart-modifications-refresh-after-releva.DxVG7X0d_1Ithqo.webp) *Merchant platform (OpenCart admin).*

3. Go to **Extensions › Extensions** and choose **Modules** in the extension type list.

   ![OpenCart admin: Extensions page with Modules chosen as the extension type](https://releva.ai/documentation/_astro/opencart-extensions-choose-modules.BBd54Sdp_ZiUNVF.webp) *Merchant platform (OpenCart admin).*

4. Scroll to **Releva** and select the green install (plus) button, then the blue edit (pencil) button.

   ![OpenCart admin: the Releva module row with the install button highlighted](https://releva.ai/documentation/_astro/opencart-releva-module-install-button.D9-aSCRM_cL4Ex.webp) ![OpenCart admin: the Releva module row with the edit button highlighted](https://releva.ai/documentation/_astro/opencart-releva-module-edit-button.Bw-Fk_jD_Z29Ua17.webp) *Merchant platform (OpenCart admin).*

The package also contains the extensions **Releva Recommenders** and **Releva Banners**. Install **Releva** first. If product blocks or banners do not show on your storefront after setup, install and enable the other two the same way.

## Configure

### 1. Copy your keys and tokens from Releva

Open **Settings › Shop & Integration**. On the **General** tab, copy **Access Token** and **Secret Key** with the copy icon next to each field. Guide: [Find your Access Token and Secret Key](https://releva.ai/documentation/guides/shop-settings/find-your-api-keys/).

Then collect one page token per page type from **Personalization › Product Blocks**: open the page selector, pick the page, and copy its **Token:** with the copy icon. One token per page serves both product blocks and banner blocks. If a page type has no Releva page yet, select **New Page**, name it and save it to get its token. The steps are the same as in [Copy your page tokens for the WooCommerce plugin](https://releva.ai/documentation/integrations/woocommerce/copy-your-page-tokens/); the screenshots are in [Verify](https://releva.ai/documentation/integrations/opencart/connect-your-opencart-store/#verify).

### 2. Paste them into the module

On **Edit Releva Module** (breadcrumb **Home › Extensions › Releva**), under **Shop settings**:

| Module field                                                                                      | Value                                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Status**                                                                                        | **Enabled**                                                                                                                                                                     |
| **Shop Access Token**                                                                             | **Access Token** from **Settings › Shop & Integration › General** (older module versions call it the “access key”)                                                              |
| **Shop Secret Key**                                                                               | **Secret Key** from the same tab                                                                                                                                                |
| **Name of cookie which stores user consent for data processing**                                  | The name of the cookie your consent banner sets when a visitor accepts, for example `cookielaw`                                                                                 |
| **Value of the cookie which signifies that the user has given their consent for data processing** | The value that means consent was given, for example `1`. Optional: leave it empty to check only that the cookie exists                                                          |
| **Product Image Width (px)**, **Product Image Height (px)**                                       | Size of the product images the module reports in the catalog                                                                                                                    |
| **Collect Push Notification Permissions**                                                         | **Enabled** only if you send web push notifications from Releva. See [Create a web push notification](https://releva.ai/documentation/guides/push-notifications/create-a-web-push-notification/) |
| **Show out of stock products that can be ordered**                                                | Reports products that are out of stock but can still be ordered as available                                                                                                    |

![OpenCart admin: Edit Releva Module with Status, Shop Access Token, Shop Secret Key and Collect Push Notification Permissions highlighted](https://releva.ai/documentation/_astro/opencart-releva-module-shop-settings.D0F5mLmn_Z1LSYEN.webp) *Merchant platform (OpenCart admin).*

If your store is subject to data protection laws such as GDPR or CCPA, fill in the consent cookie before you save. A wrong consent configuration is your responsibility, not Releva’s. On every push the Releva SDK sends `profile.consent` as `cookiesPolicy` when the check passes and `mandatoryCookies` otherwise; how Releva treats each value is in [How consent works in Releva](https://releva.ai/documentation/learn/consent/how-consent-works-in-releva/).

![OpenCart admin: the two consent cookie fields highlighted](https://releva.ai/documentation/_astro/opencart-releva-module-consent-cookie.AQM00ysF_Jw59h.webp) *Merchant platform (OpenCart admin).*

Further down, paste one page token into each page section:

| Module field            | Releva page                   |
| ----------------------- | ----------------------------- |
| **Home page Token**     | your home page                |
| **Category page Token** | your category or listing page |
| **Product page Token**  | your product page             |
| **Cart page Token**     | your cart page                |
| **Checkout page Token** | your checkout page            |
| **Search page Token**   | your search results page      |
| **Specials page Token** | your specials (offers) page   |

Leave a field empty if you do not want personalization on that page type. Select the save icon (blue disk, top right).

![OpenCart admin: the seven page token fields, Check Releva status and Product Sync buttons](https://releva.ai/documentation/_astro/opencart-releva-module-page-tokens.BkMoqJI4_2lQJFy.webp) *Merchant platform (OpenCart admin).*

Under **Releva Integration**, **Check Releva status** checks the keys against Releva and **Product Sync** starts a catalog sync. You can also start a catalog sync from Releva with **Sync Now**.

### 3. Other OpenCart pages

To personalize a page that is not one of the seven types above, create a Releva page for it with **New Page** on **Personalization › Product Blocks**, copy its token, and add this snippet to the OpenCart page template, with your token in place of the placeholder:

```plaintext
<script>
window.relevaPageToken = '<your_custom_page_token>';
</script>
```

The module’s own template reads this snippet, not the Releva SDK, so it depends on your module version. As a fallback that needs no snippet, set **URL Path** in the Releva page’s settings (the settings icon next to **Token:**): Releva then matches page views by path when no token is sent.

### 4. In Releva: check the sync settings

When the shop was created with platform **OpenCart**, Releva filled in three addresses from the shop **URL**:

| Setting                                          | Where in Releva                                                                              | Default                                                                                             |
| ------------------------------------------------ | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Catalog sync URL (**Catalog Sync Type** **API**) | **Settings › Shop & Integration › Catalog Sync**                                             | `https://your-shop.example.com/index.php?route=extension/module/releva_products`                    |
| **Subscriber Sync API**                          | **Settings › Messaging › General**, visible when **Subscription Management** is **External** | `https://your-shop.example.com/index.php?route=extension/module/releva_subscribers`                 |
| **Email Unsubscribe URL**                        | Same place                                                                                   | `https://your-shop.example.com/index.php?route=account/newsletter` (OpenCart’s own newsletter page) |

Two things are not set for you:

* **Catalog Sync Schedule** is empty. Releva presets a nightly schedule for Shopify shops only. Without a cron expression Releva never pulls your full catalog on its own; **Sync Now** starts one by hand. Follow [Schedule a full catalog sync](https://releva.ai/documentation/guides/shop-settings/schedule-a-catalog-sync/).
* **Subscription Management** defaults to **Internal** on **Create Shop**. In that mode the two subscriber fields are hidden. If OpenCart stays the record of who is subscribed to your newsletter, switch to **External** and save: [Choose how Releva manages subscriptions](https://releva.ai/documentation/guides/consent/choose-how-releva-manages-subscriptions/).

If your store lives in a subfolder, or SEO URLs rewrite `index.php?route=`, edit the addresses so that they still reach the module’s routes.

## Verify

### Check that Releva sees your OpenCart shop

Recorded in the Releva admin on a demo shop set up as an OpenCart shop, signed in as a regular user. Nothing is typed or saved. The shop name, URL, keys and token are masked.

1. Open **Settings › Shop & Integration**. On the **General** tab, **Platform** shows **OpenCart** or **PrestaShop**

   ![Step 1](https://releva.ai/documentation/_astro/step-1.YVZPPdMA_Z1hIOzs.webp)

2. **Access Token** is the public key. The OpenCart module asks for it next to the secret key. Select the copy icon next to it to copy it

   ![Step 2](https://releva.ai/documentation/_astro/step-2.B8BHRYLS_1085t8.webp)

3. **Secret Key** is the private key both modules ask for. Select the copy icon next to it to copy it, and keep it out of public pages

   ![Step 3](https://releva.ai/documentation/_astro/step-3.C3B6ZlDQ_1ziU94.webp)

4. Select the **Catalog Sync** tab

   ![Step 4](https://releva.ai/documentation/_astro/step-4.C0tY1a9a_Z23rk9u.webp)

5. With **API** selected, this is the address Releva reads your catalog from. For OpenCart it ends in `index.php?route=extension/module/releva_products`, for PrestaShop in `index.php?fc=module&module=releva&controller=products&id_lang=1&ajax=true`. Releva fills it in when your shop is created

   ![Step 5](https://releva.ai/documentation/_astro/step-5.D83BYiNz_Z1dvSwk.webp)

6. **Sync History** lists each catalog sync with its status and product count. **Last successful sync: Never** means Releva has not read your catalog yet

   ![Step 6](https://releva.ai/documentation/_astro/step-6.CWTl-W-z_Z2bMd7t.webp)

7. For OpenCart, **Settings › Messaging** › **General** with **Subscription Management** set to **External** also shows **Subscriber Sync API**, the module’s newsletter-subscriber endpoint, and **Email Unsubscribe URL**, your shop’s newsletter page

   ![Step 7](https://releva.ai/documentation/_astro/step-7.Bk6W6aiw_1VjLx6.webp)

8. The OpenCart module also asks for page tokens. Go to **Personalization › Product Blocks**, pick a page in the page selector and copy its **Token:** with the copy icon

   ![Step 8](https://releva.ai/documentation/_astro/step-8.Cw2bbchO_Z23Erqf.webp)

Select **Test** next to the catalog address to make Releva request page 1 of your catalog endpoint with your secret key; the response, or the error, appears under the field. Select **Sync Now** to start a full sync; it appears in **Sync History** once it has run. **Sync Now** next to **Subscriber Sync API** does the same for subscribers.

### Check that your shop’s data reaches Releva

Open your shop in a browser and visit a few pages, view a product and add it to the cart. Then check **Data Platform › Events**, **Data Platform › Products** and **Data Platform › Profiles** in Releva. The screens are the same for every integration: [Check that your store data arrives](https://releva.ai/documentation/integrations/check-that-your-store-data-arrives/).

On **Data Platform › Events**, **Page:** names the Releva page whose token the module sent for that page type. A row with **URL: View in browser** but no **Page:** means the token field for that page type is empty or wrong. Other event types to look for once the module runs: **Viewed Product**, **Cart Item Added**, **Cart Checkout Completed** and **Registered**.

## Troubleshooting

**Nothing appears on Data Platform › Events.** Check that **Status** is **Enabled** and **Shop Access Token** equals the **Access Token** in Releva (not the **Secret Key**; both are UUIDs). Open the page source of your storefront and look for `releva-sdk-js`. If it is missing, refresh **Extensions › Modifications** again and clear OpenCart’s cache. If the snippet is there but no events arrive, and your consent cookie is configured, accept your cookie banner first. Use the [tracking-snippet check](https://releva.ai/documentation/reference/sdk/endpoints-the-releva-sdks-call/#check-the-tracking-snippet-with-curl) to confirm the shop’s **Access Token** works.

**Events arrive, but without Page: links.** The module sends a page token per page type. Fill in the matching **… page Token** field, or set **URL Path** in the Releva page’s settings so Releva can match the page by path when no token is sent.

**Test on the Catalog Sync tab fails.** Releva calls `GET <url>&page=1` with `user-agent: Releva/0.0.1` and the secret key in both `authorization` and `x-rlv-authorization: Bearer <secretKey>`, and expects JSON with `products` and `pageCount` or `nextCursor`. The second header exists because Apache with PHP often strips the standard `Authorization` header; it was added for OpenCart shops. A `404` or an HTML page means the URL does not reach the module: check a subfolder or SEO URL rewriting of `index.php?route=`. An authentication error means **Shop Secret Key** differs from the **Secret Key** in Releva. The contract is in [the catalog pull-sync reference](https://releva.ai/documentation/reference/catalog/let-releva-pull-your-catalog/).

**Test fails with a 403 from your hosting.** Some hosts and security extensions block unknown user agents. Releva’s requests identify as `Releva/0.0.1`; the agent was renamed from `RelevaBot` in 2024 because OpenCart hosts blocked it. Allow-list `Releva/` and the two `route=extension/module/releva_*` URLs.

**Products disappear from Releva after a full sync.** About 120 seconds after a complete pass, Releva deletes every product the endpoint did not return. Disabled or out-of-stock products should still be returned with `available: false`; see **Show out of stock products that can be ordered** above and [Full syncs delete what they do not see](https://releva.ai/documentation/learn/catalog/how-your-catalog-gets-into-releva/#full-syncs-delete-what-they-do-not-see).

**Sync History stays at Last successful sync: Never.** No schedule is preset for OpenCart shops. Enter a cron expression under **Catalog Sync Schedule** or select **Sync Now**.

**The module does not install, or its files are missing after install.** On OpenCart 3 the installer fix from [Install](https://releva.ai/documentation/integrations/opencart/connect-your-opencart-store/#1-allow-the-installer-to-create-folders-opencart-3-and-23) must be installed and **Modifications** refreshed before the Releva zip is uploaded.

**Subscriber Sync API Test is disabled.** In the current admin that button depends on the catalog sync URL, not on the subscriber URL. Use **Sync Now** instead.

**Help links in the Releva admin open old documentation pages.** The **Catalog Sync** tab links to `/documentation/sync-apis/periodical-product-sync/` and the **Email Unsubscribe URL** help to `/documentation/gdpr-identity-apis/unsubscribe/`; their content is now in [the catalog pull-sync reference](https://releva.ai/documentation/reference/catalog/let-releva-pull-your-catalog/) and [How consent works in Releva](https://releva.ai/documentation/learn/consent/how-consent-works-in-releva/).

## What syncs

What a module sends can change between module versions. If you depend on one of these calls, ask your account manager whether your module version makes it.

| Data                                                            | Direction and endpoint                                                                                                                                                                                                           | When                                                                                                     |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| Catalog, full                                                   | Releva pulls `GET https://your-shop/index.php?route=extension/module/releva_products&page=&cursor=` with `user-agent: Releva/0.0.1`, `authorization` and `x-rlv-authorization: Bearer <secretKey>`; the module serves this route | **Catalog Sync Schedule**, **Sync Now**, **Product Sync** in the module, or `POST /api/v0/products/sync` |
| Product deletes                                                 | `DELETE /api/v0/products/{id}`, secret key                                                                                                                                                                                       | On product delete                                                                                        |
| Catalog, incremental                                            | `POST /api/v0/products`, `POST /api/v0/products/availability`                                                                                                                                                                    | On product save or stock change                                                                          |
| Subscribers, full                                               | Releva pulls `GET https://your-shop/index.php?route=extension/module/releva_subscribers&page=&cursor=` (same headers); each item is upserted as a profile with its `subscribedAt`                                                | **Sync Now** next to **Subscriber Sync API**, or `POST /api/v0/subscribers/sync`                         |
| Page views, product views, cart, search, the logged-in customer | Browser. The module renders the Releva SDK snippet with the page token for the page type; the SDK posts the page context to `POST /api/v0/push/{accessToken}` and receives the product blocks and banners for the page           | Every storefront page                                                                                    |
| Tracking consent                                                | The module checks the configured consent cookie; the SDK sends `profile.consent` as `cookiesPolicy` or `mandatoryCookies`                                                                                                        | Every push                                                                                               |
| Web push subscriptions                                          | The SDK registers a service worker and posts the subscription to `POST /api/v0/pushSubscriptions/{accessToken}`                                                                                                                  | When **Collect Push Notification Permissions** is **Enabled** and the visitor accepts                    |
| Customers (registration)                                        | `POST /api/v0/register` or `POST /api/v0/profiles`, secret key                                                                                                                                                                   | On registration                                                                                          |
| Newsletter consent                                              | `POST /api/v0/subscribe`, `POST /api/v0/unsubscribe`, secret key (Releva calls these “the merchant plugins’ route”); the **Email Unsubscribe URL** default points at OpenCart’s `account/newsletter` page                        | On newsletter opt-in or opt-out                                                                          |
| Orders                                                          | SDK push with a paid cart on the success page, or `POST /api/v0/carts` with `cartPaid` and `orderId`                                                                                                                             | On order placement                                                                                       |
| Order status changes                                            | not sent                                                                                                                                                                                                                         |                                                                                                          |
| Refunds                                                         | `POST /api/v0/refunds`                                                                                                                                                                                                           |                                                                                                          |
| Personal data erasure                                           | `DELETE /api/v0/profiles`, secret key (Releva calls it the merchant-plugin erasure endpoint)                                                                                                                                     |                                                                                                          |
| Product blocks and banners                                      | Rendered from the push response; the package ships **Releva Recommenders** and **Releva Banners** extensions                                                                                                                     | Every page                                                                                               |

Pushing changes keeps Releva current between syncs; the full sync is the safety net. See [How Releva connects to your shop](https://releva.ai/documentation/learn/shop-settings/how-releva-connects-to-your-shop/).

## Next steps

* [Check that your store data arrives](https://releva.ai/documentation/integrations/check-that-your-store-data-arrives/): Confirm that events, products and customers from your shop reach Releva.
* [Choose how Releva manages subscriptions](https://releva.ai/documentation/guides/consent/choose-how-releva-manages-subscriptions/): Decide whether Releva or your shop manages subscriptions, and whether sign-ups need a confirmation.
* [Schedule a full catalog sync](https://releva.ai/documentation/guides/shop-settings/schedule-a-catalog-sync/): Set where Releva pulls your catalog from and how often.
* [How product blocks work](https://releva.ai/documentation/learn/product-blocks/how-product-blocks-work/): Learn how pages and tokens connect a product block to your shop.