Skip to content

How to Track WordPress Website Events on Facebook or Google?

Key Takeaways

  • Nexter Blocks Event Tracking extension tracks Facebook events, Google events, and custom events on Facebook and Google Analytics.
  • Nexter Blocks requires the default WordPress Block editor, the Nexter Blocks plugin installed and activated, and the PRO version for this premium feature.
  • Nexter → Extra Options → Settings enables Add Event Tracking ID, and the tracking option works on buttons, forms, or custom links through Advanced > Event Tracking.
Table of Contents

Knowing that a page was viewed tells you very little. Knowing which button was clicked on it tells you what to change.

Event tracking turns any Nexter block into a tracked element: when someone clicks a link or submits a form inside it, an event goes to Google Analytics, the Meta pixel, or both.

Before You Start

  • Edition: Pro — event tracking needs Nexter Blocks Pro.
  • Block to enable: Event Tracking, switched on under Nexter > Blocks in your WordPress dashboard.
  • A GA4 measurement ID, a Meta pixel ID, or both, entered in Nexter’s settings.
  • Event tracking switched on in those same settings — see the note below.

Save the event tracking setting as enabled before you configure anything on a block. Measured on 5.0.6: with that setting never saved, the editor still offers event tracking, but the published page contains no tracking markup at all. Enabling it and changing nothing else fixed it immediately.

Steps

  1. Enter your GA4 measurement ID and Meta pixel ID in Nexter’s settings, and switch event tracking on.
Event tracking settings
  1. Select a block, open its Advanced tab, and choose which providers to send to and which event to send.
Event Tracking panel in the Advanced tab with the Facebook Pixel and Google Analytics switches
  1. Publish, then confirm the event arrives in Google Analytics’ realtime view or the Meta pixel helper.

How It Behaves

  • Turn event tracking on in Nexter’s settings first. Measured: with the site-level setting unset, a block configured for both providers emitted nothing — no markup, no console message, no warning. With the setting enabled and nothing else changed, the same block immediately emitted its full tracking payload.
  • The editor can show event tracking as available while the front end emits nothing. Measured on 5.0.6: with the setting never saved, the editor treats it as on but the front end requires it to be explicitly enabled. If your events are not firing, open the setting and save it as enabled even if it already looks on. Reported to the developers.
  • The whole configuration is written onto the block. Measured: the block gains a tpgb-event-tracker wrapper and an inner element carrying a data-event-opt attribute holding the providers, the event type and name, and any custom properties. You can confirm your setup reached the page by looking for that attribute.
  • Only certain things inside the block fire an event. Read from the shipped script, this is the complete list, all on click: any link, a video play button, and the submit button of Mailchimp, WPForms, Everest Forms or Contact Form 7. A block containing none of those is tracked in name only.
  • Binding happens once, when the page loads. Blocks added to the page later by AJAX are not picked up.
  • Ticking neither provider renders nothing, even with properties filled in. At least one of Google or Facebook has to be selected.
  • Measured with Nexter Blocks Pro deactivated: a fully configured block emits no tracking markup at all. Event tracking is Pro only and does not degrade.
  • Either provider works alone. Measured: Google only and Facebook only each rendered correctly; you do not need both.

Limitations

  • What this page verified, and what it did not. The markup the block emits and the calls the script makes were measured. Whether an event arrives in your analytics account was not, and cannot be from the page source. Confirm arrival in the provider’s own tools.
  • Only a fixed set of elements fire events. There is no way to bind to an arbitrary element inside the block.
  • A block added by AJAX after page load is not tracked, because binding happens once on load.
  • Custom properties reach Google only. Read from the script: properties are merged into an object and passed on every Google call, while the Facebook calls are made with the event name alone. If you need properties on a Meta event, this feature will not send them.
  • Setting a pixel ID also fires a PageView on every page, independently of any block, which is worth knowing before you add one.
  • It is Pro only, and emits nothing without Pro rather than degrading.

Troubleshooting

No events are firing at all

Check the site-level event tracking setting first and save it as enabled even if it looks on. This is the most common cause by a wide margin, and it produces no error anywhere.

How do I tell whether the block is set up correctly?

View the published page’s source and look for data-event-opt on the block. If it is there, the setup reached the page. If it is not, the problem is the setting above, not the block.

The attribute is there but nothing reaches my analytics

Open the browser console. The script logs gtag is not defined or fbq is not defined when the provider library has not loaded, which usually means the ID is missing or a consent or blocking script has stopped it.

Clicks on the block do nothing

Events fire from links and from a small set of form submit buttons. A block with neither has nothing to bind to.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!

Related Frequently Asked Questions

What is event tracking in WordPress?

Event tracking is how you learn which actions on a page actually matter, not just that the page loaded. In Nexter, a block can become a tracked element so clicks on links or form submits send an event to Google Analytics, the Meta pixel, or both. That matters because it turns button clicks and form actions into data you can act on instead of guessing from page views alone.

What do I need before setting up WordPress event tracking?

Nexter Blocks Pro is required, and the site-level Event Tracking option has to be enabled under Nexter > Blocks in your WordPress dashboard. You also need a GA4 measurement ID, a Meta pixel ID, or both entered in Nexter's settings. The important gotcha is that the global setting must be saved as enabled before block-level configuration will actually produce tracking markup.

Why are no WordPress events firing at all?

The most common failure is the site-level Event Tracking setting not being saved as enabled, even if it looks switched on in the editor. When that happens, the published page can contain no tracking markup and no error message at all. In practice, this is the first thing to check because it blocks every block-level setup before analytics ever sees a click.

How do I know if my Nexter block event tracking is set up correctly?

The published page source should contain a data-event-opt attribute on the block. That attribute means the configuration reached the front end and includes the provider choices, event type, name, and any custom properties. If it is missing, the problem is usually the site-level Event Tracking setting rather than the individual block settings.

Why do clicks on my tracked block do nothing?

Only a fixed set of elements inside the block can fire events: any link, a video play button, and submit buttons for Mailchimp, WPForms, Everest Forms, or Contact Form 7. If your block does not contain one of those triggers, there is nothing for Nexter Blocks to bind to. That means a visually clickable area can still be invisible to event tracking if it is not one of those supported elements.

Can I track custom properties in Google Analytics and Facebook pixel events?

Custom properties go to Google only. The script merges them into an object for Google calls, but Facebook calls are sent with the event name alone. That makes this useful when you want extra context in Google Analytics 4, but it will not carry those same properties into Meta events. Also note that setting a pixel ID fires a PageView on every page independently of any block.

Last reviewed: September 28, 2026

Related Docs