Zero Bad Leads
Send Leads6 min readFebruary 25, 2026

Tracking Script (zbp.js)

How to install the tracking script to capture browser data and improve the quality of events sent to Meta and Google Ads.

What is the Tracking Script?#

zbp.js is a lightweight script (~2KB) that you install on your client's website to automatically capture browser data that drastically improves the quality of events sent to Meta and Google Ads.

Each team receives a unique script with its identifier embedded (similar to the Meta Pixel). The tracking code is automatically generated on the Optimize Campaigns page.

Important: Zero Bad Leads only sends conversion events to Meta/Google when the lead reaches the minimum score defined in the integration's dispatch filters. This means ad platforms only receive signals from qualified leads, training the algorithm to find people with a profile similar to your best leads.

Without the script#

When a lead arrives via webhook, Zero Bad Leads sends only personal data (email, phone, name) to ad platforms. This results in:

  • Meta CAPI: Event Match Quality (EMQ) of ~3-5/10
  • Google Ads: match rate of ~30-50%

With the script#

zbp.js captures browser data that platforms need for precise matching:

  • Meta CAPI: EMQ rises to ~7-9/10, with perfect deduplication with the Pixel
  • Google Ads: match rate rises to ~90%+

The script is optional — your integrations work normally without it. zbp.js only improves the quality of sent data, resulting in better campaign optimization and lower cost per lead.

What does the script capture?#

DataDescriptionImpact
_fbpMeta Pixel cookie (browser identifier)Deduplication and match with Meta
_fbcFacebook Click ID (from ad clicks)Meta conversion attribution
gclidGoogle Click ID (from Google ad clicks)Google Ads conversion match
UTMssource, medium, campaign, term, contentOrigin tracking
Page URLPage where the lead convertedContext for Meta
User AgentBrowser and deviceAdditional Meta match

The script does not make any external requests — it only reads browser data and injects it as hidden fields in the page's forms. The data is only sent when the visitor submits the form.

Install the script#

Copy the code

Go to Optimize Campaigns in the sidebar. In the Tracking Script section, copy your team's unique snippet:

<script src="https://app.zerobadleads.com/zbp.js" data-team="YOUR_TEAM_ID" defer></script>

Each team has a unique code. Always copy the snippet from the Optimize Campaigns page — do not manually change the data-team value.

Paste on the client's website

Add the script before the </head> tag in the site's HTML. See below for instructions for each platform.

Verify

After installing, submit a test lead through the website form. In the lead detail view in Zero Bad Leads, you will see the "zbp.js active" badge in the UTM parameters section, along with the captured data.

Installation by platform#

WordPress#

With a plugin (recommended):

  1. Install the free WPCode plugin (or Insert Headers and Footers)
  2. Go to WPCode > Header & Footer
  3. Paste the script in the Header section
  4. Save

Without a plugin (in the theme):

  1. Go to Appearance > Theme Editor
  2. Open the header.php file
  3. Paste the script before </head>
  4. Save

Webflow#

  1. Go to Project Settings > Custom Code
  2. In the Head Code section, paste the script
  3. Publish the site

Wix#

  1. Go to Settings > Custom Code
  2. Click Add Code
  3. Paste the script, select Head and All Pages
  4. Save

Unbounce#

  1. Open the landing page in the editor
  2. Go to Javascripts & Stylesheets
  3. Paste the script in the Head section
  4. Save and publish

Others#

For any platform that allows adding custom code to the site's <head>, simply paste the snippet. The script works with any native HTML form, including:

  • Elementor Forms
  • Contact Form 7
  • WPForms
  • Gravity Forms
  • RD Station Forms

Forms in iframes#

Forms that run inside iframes (such as Typeform and JotForm) are not compatible with zbp.js, because the script cannot access content inside the iframe. In these cases, tracking data will not be captured.

How to know if it's working?#

  1. Submit a lead through the website form
  2. Open the lead in Zero Bad Leads
  3. In the UTM Parameters section, look for the green "zbp.js active" badge
  4. The captured data (Meta Browser ID, Google Click ID, etc.) will appear below the UTMs

Signal Quality#

Each event sent to Meta or Google Ads receives a signal quality score from 0 to 100, based on the matching data present in the lead. The more data available, the higher the match rate on the platforms.

Meta CAPI#

FieldPoints
Email20
Phone15
Client IP15
Meta Browser ID (_fbp)15
Meta Click ID (_fbc)10
User Agent10
Name5
External ID5
Page URL5
FieldPoints
Email25
Phone25
Google Click ID (gclid)30
Name10
Consent10

Important: Events for Meta and Google Ads are only sent when zbp.js is installed. Without the script, dispatch jobs for these platforms will be marked as "Skipped". Integrations with CRMs (HubSpot, Pipedrive, RD Station, etc.) continue to work normally, regardless of the script.

Privacy and security#

  • The script does not send data to any server — it only injects hidden fields in forms
  • It only reads existing first-party cookies (_fbp, _fbc from Meta Pixel)
  • URL parameters (gclid, UTMs) are public browsing data
  • Size: ~2KB (gzip ~1KB) — zero performance impact
  • Not blocked by ad blockers (makes no network requests)
  • Compatible with GDPR/LGPD when the site already has cookie consent for the Meta Pixel

Troubleshooting#

"zbp.js active" badge does not appear on the lead:

  • Check that the script is in the site's <head> (use "View Source" in the browser)
  • Confirm the form is not inside an iframe (Typeform, JotForm)
  • The form builder needs to send all form fields in the webhook, including hidden fields

gclid is not being captured:

  • The gclid only appears in the URL when the visitor clicks a Google Ads ad
  • To test, add ?gclid=test123 to the site URL and submit the form

_fbp is not being captured:

  • The _fbp cookie is created by the Meta Pixel. Check that the Meta Pixel is installed on the site
  • The visitor needs to have accepted cookies (if there is a cookie banner)