Clean traffic pixel trigger
Most advertisers fire their tracking pixel on every page view, which means bots, scrapers, and click fraud all end up in the data your ad platform learns from. With ClickPatrol you can flip this around: instead of letting every visitor hit the pixel and excluding the bad ones afterwards, you fire the pixel only when ClickPatrol has classified the visit as legitimate. The result is a pixel that collects clean traffic only, so platforms like Meta and LinkedIn optimize on real users from the very first signal.
What is a pixel?#
A pixel (sometimes called a tracking pixel, conversion pixel, or insight tag) is a small snippet of code that an advertising platform places on your website. Examples include the Meta Pixel, the LinkedIn Insight Tag, and the TikTok Pixel. Every time it fires, it sends data about the visit back to the platform.
That data is used for three things:
- Conversion tracking: measuring which ads led to purchases, leads, or sign-ups.
- Audience building: creating retargeting and lookalike audiences from your visitors.
- Optimization: teaching the platform's algorithm what a valuable visitor looks like so it can find more of them.
Because the pixel both measures and trains your campaigns, the quality of who hits it directly shapes who your ads are shown to next.
How this connects to ClickPatrol#
ClickPatrol sits in front of your pixel. The ClickPatrol tag runs in Google Tag Manager, inspects each ad visit, and classifies it as legitimate or suspicious before any pixel fires. Normally a pixel fires on every page view, so bots, scrapers, click farms, and competitor clicks all feed into your audiences and optimization models.
By using ClickPatrol's classification as the trigger for the pixel, you decide what is allowed to reach the platform. When you fire the pixel only on the ClickPatrol_Legitimate event, suspicious ad traffic is filtered out before it ever touches your pixel, so the platform only ever learns from clean traffic.
Why gate the pixel on clean traffic#
Your advertising pixel does more than count conversions. It builds the audiences and feeds the optimization models that decide who sees your ads next. When invalid traffic reaches the pixel, those models learn from the wrong people.
- Cleaner audiences: Retargeting and lookalike audiences are built only from genuine visitors, not bots or fraudulent clicks.
- Better optimization: The platform's algorithm optimizes toward real users with intent instead of low quality traffic.
- More accurate data: Your pixel events reflect actual people, so reporting and signal quality improve.
- Prevention, not cleanup: Bad traffic never enters the pixel in the first place, so there is nothing to exclude later.
How it works#
When the ClickPatrol tag fires, it classifies the visit and pushes a classification event to the DataLayer using a standard dataLayer.push. Legitimate visits push a ClickPatrol_Legitimate event, suspicious visits push a ClickPatrol_Suspicious event. For example:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
"event": "ClickPatrol_Legitimate",
"traffic": "safe",
"audience": { /* your configured audiences, e.g. "exclude_suspicious": false */ }
});
Because ClickPatrol_Legitimate is a regular DataLayer event, you can use it as the trigger for any tag in Google Tag Manager, including your Meta Pixel, LinkedIn Insight Tag, or any other advertising pixel. By pointing the pixel's trigger at this event instead of All Pages or Page View, the pixel only fires when the visit is classified as clean.
Step 1: Install the ClickPatrol tag in Google Tag Manager#
Before you start, make sure the ClickPatrol tag is installed and firing on All Pages in Google Tag Manager, and that your advertising pixel is already available in the same container. If you have not set up the tag yet, start with the Google Tag Manager article.
Step 2: Create a Custom Event Trigger for ClickPatrol_Legitimate#
This trigger is what tells your pixel to fire only on clean traffic.
- Go to Triggers and click New.
- Click Trigger Configuration and select Custom Event.
- Set the Event Name to ClickPatrol_Legitimate. Leave Use regex matching off so the trigger fires only for legitimate traffic, not for suspicious traffic.
- Under This trigger fires on, select All Custom Events.
- Name the trigger (for example, ClickPatrol Legitimate) and click Save.
Note: This is a separate trigger from the regex ClickPatrol_.* trigger used to forward all events to GA4. For gating a pixel you want the exact ClickPatrol_Legitimate event only.
Step 3: Point your pixel at the ClickPatrol_Legitimate trigger#
Now change the trigger on the pixel tag itself so it stops firing on every page and only fires on clean traffic.
- Go to Tags and open your advertising pixel tag (for example, your Meta Pixel or LinkedIn Insight Tag).
- Click Triggering.
- Remove the existing All Pages (or Page View) trigger.
- Add the ClickPatrol Legitimate trigger you created in Step 2.
- Click Save.
From now on, the pixel only fires when ClickPatrol confirms the visit is legitimate. Suspicious ad traffic never reaches the pixel.
Step 4: Publish#
- Click Submit in GTM to publish the container with all your changes.
- Confirm the version is live before testing.
Verify your setup#
ClickPatrol events only fire for ad traffic. To test your setup manually, add ?source=f to your website URL:
*https://www.yourwebsite.com/?source=f*
- In GTM, click Preview (top right).
- Enter your URL with ?source=f appended and click Connect.
- In the Tag Assistant window, click the ClickPatrol_Legitimate event in the list on the left.
- Confirm that your pixel tag now appears under Tags Fired on that event.
- Click a normal Page View or a ClickPatrol_Suspicious event and confirm the pixel appears under Tags Not Fired.
Finally, confirm the events arrive in your ad platform's own tool, such as Meta Events Manager or the LinkedIn Insight Tag status, so you know clean conversions are still being received.
ClickPatrol events only fire for ad traffic that carries the UTM and source parameters from your campaigns. If you gate the entire pixel on ClickPatrol_Legitimate, the pixel will no longer fire for organic or direct visitors at all. This is exactly what you want when the goal is a pixel that collects clean ad traffic only. If you also need full-site tracking for organic visitors, keep a separate base pixel firing on All Pages and use the ClickPatrol_Legitimate trigger only for the ad-driven events you want to keep clean.
Next steps#
Gating the pixel pairs well with the platform specific integrations, which also let you build exclusion audiences from the same ClickPatrol events:
- Meta - Events: send your ClickPatrol events to the Meta Pixel and confirm them in Meta Events Manager.
- Meta - Audiences: build a Custom Audience from those events and exclude suspicious traffic from your ad sets.
- LinkedIn: connect your LinkedIn ads so traffic is classified before it reaches the Insight Tag.
Was this article helpful?
Let us know so we can improve our documentation
Need Help?
If something isn't working or you have questions, our support team is here to help you.
Contact Support