Skip to content

Facebook Pixel PRO

Yatra Settings → Integration → Facebook Pixel panel

Track booking funnel events in Meta Events ManagerViewContent, InitiateCheckout, Purchase — both browser-side (via the standard pixel snippet) and server-side (via Meta's Conversions API, so events still register when an ad-blocker strips the browser tag).

What you'll need

ThingWhere to get it
A Meta Business accounthttps://business.facebook.com/ — free.
A Pixel in Meta Events ManagerEvents Manager → Connect Data Sources → Web → Pixel. Walk-through below.
(Optional) Conversions API access tokenEvents Manager → your pixel → Settings → Conversions API → Generate access token.
Yatra Pro license + Facebook Pixel module enabledYatra → License + Yatra → Modules → Facebook Pixel.

Don't have a pixel yet?

Meta's setup wizard: https://www.facebook.com/business/help/952192354843755. Takes ~3 minutes — name the pixel after your site (e.g. yourshop-pixel).

Step 1 — Find your Pixel ID

  1. Sign in at https://business.facebook.com/events_manager.
  2. From the left rail pick Data sources.
  3. Click your pixel row.
  4. The Pixel ID is the 15-or-16-digit number under the pixel name at the top of the page. Copy it.

(If you have multiple pixels for the same site, pick the one dedicated to bookings — don't share it with a separate WooCommerce or campaign-landing-page pixel.)

This step enables server-side tracking — events fire from your WordPress server, not the browser, so ad-blockers can't strip them.

  1. Still in Events Manager, on your pixel's page, click the Settings tab.
  2. Scroll to Conversions API → Set up manually → Generate access token.
  3. Click Generate access token. Meta shows the token once — it's a very long base64-like string.
  4. Copy it and save it somewhere safe.

Token rotation

The token never expires by default but you can rotate it any time from the same screen. Yatra reads it on every request, so updating the value here is enough — no plugin reload needed.

Step 3 — Enable the module

  1. Open Yatra → Modules.
  2. Find Facebook Pixel → toggle on.
  3. Reload — the Integration settings panel appears.

Step 4 — Configure in Yatra

Open Yatra → Settings → Integration → Facebook Pixel.

FieldSetting IDWhat to put
Pixel IDfacebook_pixel_idThe 15–16-digit number from Step 1.
Track ViewContentfb_track_view_contentFires when a visitor lands on a trip page.
Track InitiateCheckoutfb_track_initiate_checkoutFires when the customer clicks Book Now and lands on the checkout page.
Track Purchasefb_track_purchaseFires on successful payment. Critical for Ads ROAS reporting and lookalike-audience seeding.
Use Conversions APIfb_use_conversions_apiAdds server-side event posting alongside the browser pixel. Recommended.
Conversions API access tokenfacebook_access_tokenThe token from Step 2. Shown only when Use Conversions API is on. Treat as a password.

Step 5 — Verify in Events Manager

Meta provides a Test Events tab where you can watch live events.

  1. Open https://business.facebook.com/events_manager → your pixel → Test Events tab.
  2. Copy the Test Event Code Meta shows at the top (looks like TEST12345).
  3. In your private browser window, append ?fbtest=THE_CODE to your site URL — Yatra reads it and tags every event with that code so it shows in the Test Events tab.
  4. Visit a trip page → ViewContent should appear within ~5 seconds.
  5. Click Book NowInitiateCheckout appears.
  6. Complete a test booking → Purchase appears with the booking total.
  7. If you also enabled Conversions API: the event row shows two processing methods — Browser and Server. They should match.

Deduplication

When you send the same event from browser AND server, Meta deduplicates using event_id. Yatra emits a deterministic event_id per booking, so duplicate Purchase events from race conditions still count as one.

What each event carries

EventKey parameters
ViewContentcontent_ids (trip ID), content_name (trip title), content_type=product, currency, value
InitiateCheckoutSame as above + num_items (traveler count)
PurchaseSame + event_id (booking number), value, currency, num_items

For Conversions API events Yatra also sends hashed customer email + phone (SHA-256, in line with Meta's matching requirements) so Meta can attribute the conversion to a Facebook user.

Troubleshooting

Events show only as Browser, never Server — your access token is missing or invalid. Generate a fresh one and paste it again.

Pixel works in your private window but not in production — an ad blocker is stripping the browser tag. Turn on Use Conversions API so the server fallback fires.

Purchase events don't carry a value — your trip has no price. Set one in the Trip Builder → Pricing section.

Doubled events in Meta — another plugin (PixelYourSite, Woo Pixel, etc.) is also emitting events. Disable one of them.

iOS / Safari blocks — Safari aggressively strips third-party cookies; the Conversions API server-side path bypasses this entirely. Make sure it's on.

"Pixel could not be verified" — happens when Meta's crawler can't reach a published page. Make sure at least one trip page is publicly accessible and the pixel snippet renders. Use the Live tab in Events Manager to watch the crawler hit your URL.

Where to read more