Developer Docs

Integrate Commerce Index in 30 Minutes

Add social proof to your product pages. Show shoppers how many people are viewing and purchasing your products in real-time.

Live Social Proof

Show "X people viewing now" and "Y purchases today" on your product pages

Product Analytics

Get insights into which products are trending and driving conversions

Extension Display

Your social proof shows in our Chrome extension to millions of shoppers

Quick Start Integration

Step 1: Add the CI Script Loader
Add this snippet to your global layout (before </body>) so it loads on all relevant pages.
<script>
  (function(w, d, s, src, name) {
    if (w[name]) { return; }
    var ci = w[name] = function() {
      ci.q.push(arguments);
    };
    ci.q = [];
    var el = d.createElement(s);
    el.async = true;
    el.src = src;
    var firstScript = d.getElementsByTagName(s)[0];
    firstScript.parentNode.insertBefore(el, firstScript);
  })(window, document, 'script', 'https://cdn.commerceindex.com/ci.js', 'ci');

  // Initialize CI with your assigned brand ID
  ci('init', {
    brandId: 'YOUR_BRAND_ID'
  });
</script>

Note: We'll provide your YOUR_BRAND_ID and the exact script URL during onboarding.

API Reference

POST
/api/ci/search-enrich
Process search results and return normalized price comparisons
POST /api/ci/search-enrich
Content-Type: application/json

{
  "query": "dyson v15 vacuum cleaner",
  "results": [
    {
      "title": "Dyson V15 Detect Cordless Vacuum",
      "url": "https://www.bestbuy.com/dyson-v15",
      "price": 699.99,
      "currency": "USD",
      "domain": "bestbuy.com"
    }
  ],
  "user_context": { "country": "US", "locale": "en-US" }
}
POST
/api/ci/product-enrich
Process PDP context and return alternative prices + social proof
POST /api/ci/product-enrich
Content-Type: application/json

{
  "context": {
    "domain": "amazon.com",
    "url": "https://www.amazon.com/dp/B08...",
    "country": "US"
  },
  "product": {
    "title": "Dyson V15 Detect Vacuum",
    "brand": "Dyson",
    "price": 699.99,
    "currency": "USD"
  }
}
GET
/api/ci/product-proof
Get social proof data for a specific product
GET /api/ci/product-proof?brand_id=xyz&product_id=abc123

Response:
{
  "brand_id": "xyz",
  "product_id": "abc123",
  "views_last_60_min": 37,
  "purchases_last_24h": 12,
  "generated_at": "2025-12-22T15:30:00Z"
}
Integration Checklist (Under 30 Minutes)
1
Insert the loader snippet with your brandId into your layout
2
Add ci('trackView', ...) to your PDP template
3
Add ci('trackPurchase', ...) to your order confirmation page
4
Test locally: load PDP → verify product-view event in network tab
5
Complete a test order → verify product-purchase event
6
Notify Commerce Index team to confirm events are received

Privacy & Data

  • • We do not collect PII (no names, emails, addresses)
  • • We use anonymous session IDs for deduplication and quality
  • • Events are used to compute aggregate statistics and CI signals only

Ready to integrate?

Contact us to get your Brand ID and API key to start collecting social proof data.