Meta Pixel with CookieRay Pro

CookieRay Team
•
3 min read

Meta Pixel with CookieRay Pro

CookieRay Pro can add your Meta (Facebook) Pixel and connect it to the visitor’s consent choice. You paste a Pixel ID; CookieRay outputs the pixel code in the page head.

Set it up

  1. Make sure your Pro license is active.
  2. Open CookieRay → Settings → Integrations.
  3. Switch on Meta Pixel.
  4. Enter your Pixel ID.
  5. Click Save Integrations.

The pixel code is output only when the card is switched on and the Pixel ID is filled in.

The Meta Pixel works differently from GTM in Strict mode. CookieRay uses Meta’s own consent controls rather than holding the script back:

  1. CookieRay sets up the fbq function and immediately calls fbq('consent', 'revoke'), before fbq('init', …) runs.
  2. The Meta script (fbevents.js) loads, but with consent revoked, so no tracking is sent.
  3. When the visitor allows the Marketing category, CookieRay calls fbq('consent', 'grant').
  4. If they decline, or later withdraw consent, CookieRay calls fbq('consent', 'revoke').

On a returning visit, CookieRay sends the saved choice to the pixel straight away, so a visitor who already accepted does not need to accept again.

This is the same in Strict (Block Until Consent) and Log Only (Log Consent Only) mode. In Strict mode CookieRay lets the Meta script domain through the script blocker on purpose, because the pixel is already held in the revoked state.

The category that controls the pixel is Marketing. Analytical consent alone does not grant it.

Avoid loading the pixel twice

If your theme, another plugin, a GTM tag, or hard-coded code already adds the same pixel, turn that off or leave this integration switched off. Two copies can send duplicate events.

Test it

  1. Open your site in a private window with the Meta Pixel Helper or the Network tab open.
  2. Before you click the banner, confirm the pixel sends no page-view events.
  3. Click Accept All. Events should start.
  4. Reopen the banner settings (floating cookie settings button, if enabled), turn off Marketing and save. Tracking stops, and the page reloads so the change takes full effect.

If the banner is hidden for a visitor’s country by Geo Targeting, or switched off, the pixel code is still printed, but nothing ever sends the grant. The pixel stays revoked and does not track those visitors.

Was this article helpful?

Your response is saved on this device.