← Powrót do artykułów

Carrd: Konfiguracja piksela OpenAI Ads dla stron docelowych Carrd: Kompletny przewodnik

Instrukcja krok po kroku instalacji piksela i śledzenia konwersji OpenAI Ads na stronach docelowych Carrd za pomocą elementów Embed.

2026-04-07 • CMS & Website Builders

Carrd provides a lightweight platform for single-page sites, lead capture funnels, and product validation.

Its simplicity helps speed up deployment, but also limits server-level customization. Carrd sites do not provide custom backend servers or native API endpoints.

To track conversions accurately on Carrd, pair Carrd's native Embed element with a serverless webhook relay.

You place the measurement pixel in the head of your Carrd site to track visitor sessions. Then, configure your Carrd form to POST submissions to a webhook handler that hashes customer data and forwards verified CAPI events to OpenAI.

Here is how to set up client pixels and webhook relays on Carrd.

Adding the base pixel via an Embed element

Add the measurement script using Carrd's Embed element:

  1. Open your landing page in the Carrd builder.
  2. Click Add and select Embed.
  3. In Embed settings, set Type to Code, set Style to Head, and label it OpenAI Ads Base Pixel.
  4. Paste the base pixel snippet:

<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>
  1. Click Done and publish changes.

Tracking form submissions via section redirects

A reliable client-side method on Carrd redirects users to a dedicated completion section upon submission:

  1. Add a Control element, set Type to Section Break, and name it #done.
  2. Add an Embed element inside this section, setting Type to Code and Style to Hidden:
<script>
  (function() {
    var dedupeId = 'carrd_lead_' + Date.now();
    if (window.openaiAds) {
      window.openaiAds('track', 'Lead', {
        content_name: 'Carrd Waitlist / Lead Form'
      }, {
        event_id: dedupeId
      });
    }
  })();
</script>
  1. Select your Form element, open Completion, set On Submit to Redirect to a URL, and enter #done.

Server-side CAPI via Carrd form webhooks

To ensure form submissions register even if client scripts are blocked, configure Carrd's form to send data to a serverless relay:

  1. Select your Form element in Carrd.
  2. Set Action to Send to URL.
  3. Enter your webhook endpoint URL.
  4. Deploy a Cloudflare Worker relay function:
export default {
  async fetch(request, env) {
    if (request.method !== 'POST') {
      return new Response('Method Not Allowed', { status: 405 });
    }

    try {
      const formData = await request.formData();
      const email = formData.get('email') || formData.get('Email');
      const phone = formData.get('phone') || formData.get('Phone');

      if (!email) {
        return new Response('Email required', { status: 400 });
      }

      const hashSha256 = async (str) => {
        const buf = new TextEncoder().encode(str.trim().toLowerCase());
        const hash = await crypto.subtle.digest('SHA-256', buf);
        return Array.from(new Uint8Array(hash)).map(b => b.toString(16).padStart(2, '0')).join('');
      };

      const hashedEmail = await hashSha256(email);
      const hashedPhone = phone ? await hashSha256(phone.replace(/[^0-9]/g, '')) : null;

      const dedupeId = `carrd_lead_${Date.now()}`;

      const payload = {
        data: [
          {
            event_name: 'Lead',
            event_time: Math.floor(Date.now() / 1000),
            event_id: dedupeId,
            user_data: {
              em: hashedEmail,
              ph: hashedPhone
            },
            custom_data: {
              content_name: 'Carrd Landing Page Lead'
            },
            action_source: 'system_generated'
          }
        ]
      };

      const res = await fetch('https://bzr.openai.com/v1/events', {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${env.OPENAI_ADS_ACCESS_TOKEN}`,
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(payload)
      });

      return new Response('Success', { status: res.status });
    } catch (err) {
      return new Response('Error: ' + err.message, { status: 500 });
    }
  }
};

Verification checklist

Inspect page source code on your published Carrd site to confirm the tracking script appears in the head.

Submit a test lead through the form and check your edge worker logs to confirm the incoming POST request returns status 200.

Check OpenAI Ads Event Manager to confirm that lead conversions register with proper metadata.

Frequently asked questions

Do I need a Carrd Pro plan to install the OpenAI Ads Pixel?

Yes. Embedding custom JavaScript in Carrd requires a Pro Standard or Pro Plus subscription to unlock the Embed element and Custom Code features.

Where is custom code inserted in Carrd?

Add an Embed element anywhere on the page, set Type to Code, and set Style to Head. Carrd injects this script into the HTML document head.

How do I track form leads on Carrd?

Redirect users to a completion section like #done containing an inline Embed script, or configure the form action to send data to an external webhook relay.

Can Carrd send server-side CAPI events?

Yes. Set the form action to Send to URL pointing to a cloud worker that hashes customer data with SHA-256 and posts to https://bzr.openai.com/v1/events.

Potrzebujesz wdrożenia śledzenia ChatGPT Ads?

Skonfigurowane, przetestowane, udokumentowane.