← 返回深度文章

Big Cartel:OpenAI Ads 网页像素与转化追踪全栈部署配置指南

Big Cartel 创作者独立站接入 OpenAI Ads 转化追踪实操手册:通过高级自定义代码、结账收据钩子与 Webhook 中继实现归因。

2026-03-28 • eCommerce Platforms

Big Cartel is the platform of choice for independent artists, makers, and boutique apparel brands. But because Big Cartel keeps its store environment simple and sandboxed, setting up advanced conversion tracking for OpenAI Ads takes some careful maneuvering. If you are on a free plan, custom tracking scripts are locked out entirely; on paid plans, you have access to custom code, but you still have to deal with mobile checkouts where customers frequently exit before the confirmation page loads.

When that happens, your ad campaigns look like they generated zero sales.

We fix this by using Big Cartel's layout and checkout confirmation code blocks alongside a lightweight webhook relay (via Zapier or Make). The browser pixel logs user views and checkout clicks, while the server webhook pushes verified receipts straight to OpenAI's Conversions API. Sharing a deterministic event_id (bc_order_{order_id}) guarantees that every sale gets counted once, and only once.

Storefront Visitor (Big Cartel Layout)
       │
       ▼
[Custom Code / Layout Head] ──(bzrcdn.openai.com)──► Client Pixel (Pageview, ViewContent)
       │
       ▼ Order Confirmation Code Block
Browser Pixel Purchase (event_id: bc_order_92810)
       │
       ▼ Order Webhook / Zapier Catch Hook
[Zapier / Make Automation Relay]
       │
       ▼ cURL POST (event_id: bc_order_92810)
OpenAI Ads Conversions API (https://bzr.openai.com/v1/events)

Part 1: Site-Wide Base Pixel Setup

In your Big Cartel admin:

  1. Navigate to Account > Customize Design.
  2. Select Advanced from the design sidebar, then click Custom Code.
  3. Under the Layout tab, paste the OpenAI Ads base script directly before the closing </head> tag:

<script>
  !function(w,d,e,u,t,s){if(w.openaiAds)return;t=w.openaiAds=function(){
  t.callMethod?t.callMethod.apply(t,arguments):t.queue.push(arguments)};
  if(!w._openaiAds)w._openaiAds=t;t.push=t;t.loaded=!0;t.version='1.0';
  t.queue=[];s=d.createElement(e);s.async=!0;s.src=u;
  var f=d.getElementsByTagName(e)[0];f.parentNode.insertBefore(s,f);
  }(window,document,'script','https://bzrcdn.openai.com/pixel.js');

  openaiAds('init', 'YOUR_PIXEL_ID');
  openaiAds('track', 'PageView');
</script>

Part 2: Product Page ViewContent Tracking

Under the Product tab in Custom Code, append the following snippet to capture catalog views:

<script>
  document.addEventListener('DOMContentLoaded', function() {
    if (window.openaiAds && window.BigCartel && window.BigCartel.product) {
      var prod = window.BigCartel.product;
      var priceCents = Math.round(prod.price * 100);

      window.openaiAds('track', 'ViewContent', {
        content_type: 'product',
        content_ids: [prod.id.toString()],
        content_name: prod.name,
        value: priceCents,
        currency: 'USD'
      });
    }
  });
</script>

Part 3: Order Confirmation & Purchase Tracking

Under the Order Confirmation tab in Custom Code:

<script>
  document.addEventListener('DOMContentLoaded', function() {
    // Big Cartel provides order receipt details in the DOM / page context
    try {
      var orderId = null;
      var totalCents = 0;

      // Extract from URL or BigCartel order object
      var urlParams = new URLSearchParams(window.location.search);
      orderId = urlParams.get('order_id') || ('bc_' + Date.now());

      var totalElem = document.querySelector('.order-total, .receipt-total, [data-order-total]');
      if (totalElem) {
        var rawText = totalElem.innerText.replace(/[^0-9.]/g, '');
        totalCents = Math.round(parseFloat(rawText) * 100);
      }

      if (window.openaiAds && totalCents > 0) {
        var dedupeId = 'bc_order_' + orderId;
        window.openaiAds('track', 'Purchase', {
          currency: 'USD',
          value: totalCents,
          order_id: orderId.toString(),
          content_type: 'product'
        }, {
          event_id: dedupeId
        });
      }
    } catch (e) {
      console.warn('OpenAI Ads Purchase tracking error:', e);
    }
  });
</script>

Part 4: Server-Side CAPI via Zapier / Webhooks

Because Big Cartel supports Zapier integrations for order events, you can relay conversions to OpenAI Ads CAPI asynchronously:

  1. Trigger: Big Cartel. New Order.
  2. Action: Webhooks by Zapier. Custom Request (POST):
  • URL: https://bzr.openai.com/v1/events
  • Headers: Authorization: Bearer <OPENAI_ADS_ACCESS_TOKEN>
  • Content-Type: application/json
  • Data Payload:
{
  "data": [
    {
      "event_name": "Purchase",
      "event_time": 1743120000,
      "event_id": "bc_order_{{order_id}}",
      "user_data": {
        "em": "{{hashed_email}}",
        "country": "{{hashed_country}}"
      },
      "custom_data": {
        "currency": "USD",
        "value": 4500,
        "order_id": "{{order_id}}",
        "content_type": "product"
      },
      "action_source": "system_generated"
    }
  ]
}

Verification & QA

  • Script Manager Validation: Ensure code changes in Custom Code are published live and not left in draft preview.
  • Console Monitoring: Perform a live test transaction to confirm Purchase is dispatched with an exact event_id and monetary value in cents.
  • Event Manager Testing: Check test event logs in the OpenAI Ads dashboard to verify deduplication matching.

Frequently Asked Questions

Can I add the OpenAI Ads Pixel to Big Cartel on free plans?

No. Custom HTML and JavaScript injection requires a Big Cartel paid plan (such as Features or Titanium) that grants access to Customize Design > Custom Code.

Where do I add the OpenAI Ads Pixel in Big Cartel?

Navigate to Account > Customize Design > Advanced > Custom Code. Add the base pixel snippet to the Layout page head section.

How do I track purchases on Big Cartel checkout confirmation?

Add your purchase script under the Custom Code > Order Confirmation page in Big Cartel, accessing Big Cartel receipt variables or URL order parameters.

Can Big Cartel support server-side Conversions API (CAPI)?

Yes. By connecting Big Cartel webhooks (or Zapier integration for new orders) to an edge relay, you can send server-side purchase events to https://bzr.openai.com/v1/events.