Track Lead
The Lead event fires when a visitor submits a form — contact form, demo request, newsletter signup, consultation request, etc. Critical for service businesses, B2B lead-gen, healthcare, and real estate.

1. Find your form’s selector
We need a way for the script to find your form. The easiest way is by its id attribute. Open the page with your form in a browser, right-click the form → Inspect. Look at the <form> element in DevTools and note its id= attribute. Common ones: contact-form, lead-form, signup-form.

2. Copy the snippet
Replace #contact-form with your form’s actual #+id (e.g. #newsletter-form).
Option A — pbq (recommended)
<!-- Place inside the <body> of the page that contains the form,
AFTER the AdsPing script in <head>. -->
<script>
document.querySelector('#contact-form')
.addEventListener('submit', function () {
pbq('track', 'Lead', {
content_name: 'Contact form',
value: 0,
currency: 'USD'
});
});
</script>Option B — dataLayer
<!-- Place inside the <body> of the page that contains the form,
AFTER the AdsPing script in <head>. -->
<script>
document.querySelector('#contact-form')
.addEventListener('submit', function () {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'generate_lead',
form_name: 'Contact form',
value: 0,
currency: 'USD'
});
});
</script>3. Where to paste it
Paste it inside the <body> of the page that contains your form — ideally near the bottom, after the form HTML, so the form element exists when the script runs.

Multiple forms on your site?
Add the same snippet to every page that has a lead form, each time pointing at that page’s form ID. AdsPing will forward each one to Meta with the content_name you set, so you can tell them apart in reporting.
4. Test it
Open the page in a fresh tab, fill out the form with test data, and submit. Within 10 seconds, a new Lead row appears in your AdsPing pixel’s Recent Events list with a green Success badge.

✓ Lead is live.
Every form submission on your site is now forwarded to Meta via the Conversions API.