Framework Guides

Adobe Commerce

Install the Ours Privacy Web SDK on Adobe Commerce or Magento Open Source using the HTML Head design setting, including the Content Security Policy step.

Use this page to install the Ours Privacy Web SDK on a store running Adobe Commerce or Magento Open Source.

Adobe Commerce has a built-in admin field for head scripts, so no theme development is required for the basic install. Version 2.4.7 and later add a Content Security Policy step you need to know about before you go live.


Steps to Integrate Ours Privacy with Adobe Commerce

1. Copy your install snippet

Copy your install snippet from the Install Ours page.

2. Add the snippet to your theme's HTML head

  1. In the Admin, go to Content > Design > Configuration.
  2. Find the store view you want to track and select Edit.
  3. Expand the HTML Head section.
  4. Paste your snippet into Scripts and Style Sheets.
  5. Select Save Configuration.

If you run several store views, repeat this for each one, or apply it at the default scope so all views inherit it.

3. Allow the script in your Content Security Policy

Adobe Commerce 2.4.7 and later ship Content Security Policy in restrict mode on checkout and payment pages by default. In restrict mode, inline scripts that are not explicitly allowed are blocked by the browser and fail without an obvious error.

If tracking works on your catalog pages but stops during checkout, this is almost always the cause. Add Ours Privacy to your CSP allow list following Adobe's Content Security Policies guide.

4. Flush the cache and verify

  1. Go to System > Cache Management and flush the Magento cache.
  2. Load a storefront page and open the browser console to check for script errors.
  3. Complete a test checkout and confirm tracking continues through the order confirmation page.
  4. In your Ours Privacy account, check Recent Events to confirm page views are arriving.

Track Custom Events

Call ours('track', ...) from a template or a custom module:

ours('track', 'Added To Cart', { sku: 'ABC-123', value: 49.99 });

Next Steps

If you need further assistance, contact us at support@oursprivacy.com.

How is this guide?

On this page