Track Contact Form 7 leads with OpenAI Ads
Track a confirmed Contact Form 7 submission as an OpenAI Ads lead_created event after the mail succeeds, not when the page loads.
Last updated: 3 September 2026. Written by PixelBridge team.
Confirmed Contact Form 7 submissions should be tracked as OpenAI Ads lead events after the form reports a successful send, not when the page loads or when the submit button is clicked.
What this integration is for
Contact Form 7 is a common WordPress lead form. A typical conversion is a message that was accepted and mailed or stored, with the plugin's success response shown to the visitor.
OpenAI Ads measurement should record that success as lead_created. PixelBridge is designed to listen for the plugin's documented success path instead of asking you to paste an on_sent_ok snippet or a theme footer script. That native hook is the point of the integration. It has not shipped.
PixelBridge is independent from OpenAI and from Contact Form 7. It does not replace Contact Form 7's mail, spam or additional-settings features. Configure the form in Contact Form 7 first, then plan measurement on top.
Confirmed leads versus button clicks
Contact Form 7 validates on the server and returns a response to the page. The visitor may see a success message, an error, or a spam failure. Only the success response is a lead.
Do not treat these as conversions:
- Opening the contact page
- Filling one field
- Clicking Send
- A wpcf7-mail-sent-ok class that you add yourself before the request finishes
- A 200 response that still contains a validation error
If you use a redirect to a thank-you page, the conversion is still the successful submit. Measuring only the thank-you URL will also count people who bookmark that page.
See conversion events.
Why the integration should remove custom JavaScript
Many Contact Form 7 sites already have leftover tracking snippets: old on_sent_ok extra settings, Google Ads or Meta events in the theme, or a tag manager rule on .wpcf7-mail-sent-ok. Those snippets drift, fire twice, or fire on the wrong response.
The planned PixelBridge connector should:
- Detect that Contact Form 7 is active.
- Bind to a confirmed success event.
- Send
lead_createdthrough the OpenAI Ads Pixel when consent allows it. - Optionally send the same conversion through the Conversions API with a shared event ID.
You should not need a custom script in Additional Settings for OpenAI Ads once that ships. Until then, extra JavaScript is not the supported product path.
Browser and server events
The browser event belongs after the success response. Contact Form 7 is AJAX-based in most themes, so there may be no full page reload. A script that only runs on DOMContentLoaded will miss the lead or fire too early.
A server event can still record the lead after WordPress has accepted the submission, which helps when the pixel is blocked. Both events need the same event ID. See Conversions API.
Consent, spam and duplicates
Measurement consent must be granted before a Contact Form 7 lead is sent to OpenAI Ads. The form can still submit. The advertising event should wait. See consent.
Spam and failed mail should not become leads. If Contact Form 7 flags the message as spam or cannot send mail, there is no confirmed lead to measure.
One submit equals one event. Retries after a network error should not create two conversions for the same successful message. A second genuine submit from the same person can be a second lead if your business treats it that way. Do not debounce all submits from one IP as a substitute for a real event ID.
Setup
- Install PixelBridge from WordPress.org.
- Add your OpenAI Ads Pixel ID.
- Enable Contact Form 7 lead tracking.
- Select the forms that should count, if more than one form exists.
- Submit a test message and confirm a single
lead_createdevent in diagnostics.
Troubleshooting
- Confirm Contact Form 7 shows its success message, not a validation error.
- Confirm mail actually sends if your definition of a lead requires mail delivery.
- Grant measurement consent.
- Remove leftover custom CF7 tracking snippets before you test a future native hook, or you may see duplicates later.
- See troubleshooting if the pixel never loads.
Related
- OpenAI Ads Pixel for WordPress
- OpenAI Ads conversion tracking
- Conversion events
- Conversions API
- Consent
- Elementor Forms
- WPForms