Requires Hubbub Pro 2.31.0 or above.
Hubbub Pro can send an event to Google Analytics 4 (GA4) every time a reader clicks a share button, a follow button, or submits a Save This form. This lets you see which networks, tools, and posts get the most engagement.
Looking for Action Buttons? Action Button clicks are tracked separately. See How to count Action Button clicks including with Google Analytics.
What’s tracked #
- Share button clicks (floating sidebar, inline content, sticky bar, pop-up, and share shortcode buttons)
- Pinterest image hover (Pin It) button clicks
- Click to Tweet clicks
- Follow button clicks
- Save This form submissions
Before you start #
Google Analytics 4 must already be installed on your site with gtag (the standard Google tag). If you use Google Tag Manager (GTM) instead, Hubbub also sends the event to the dataLayer so you can pick it up with a GTM trigger.
Not sure how GA4 is installed on your site? Ask your website developer, or email us at support@morehubbub.com.
Turn on event tracking #
- In your WordPress Admin, go to Hubbub > Settings.
- In the Misc section, turn on Send Google Analytics Events.
- Click Save Changes.
Already tracking share clicks another way? Leave this setting off if your tag manager already tracks share clicks, so they aren’t counted twice.
❓Need help with GA4?
We recommend chatting with our friend and NerdPress Recommended Expert Sabrina Tatalias – The Measurement Maven – about how to gain insights from tracking these click events.
Event details #
Each click sends a GA4 event named share (GA4’s recommended event for sharing). For Google Tag Manager, the same data is pushed to the dataLayer as an event named hubbub_share.
| Parameter | What it contains | Example values |
|---|---|---|
method | The kind of button clicked | share-button, pin-it, copy, system, follow, save-this |
content_type | The network | facebook, pinterest, email |
item_id | The WordPress post ID | 1234 |
link_url | The URL being shared or followed | |
source | Where the button was | floating-sidebar, inline-content, sticky-bar, pop-up, shortcode, follow-widget, pin-it-image, save-this |
Save This submissions are sent with method and source set to save-this and content_type set to email.
Viewing the events in GA4 #
- In GA4, go to Reports > Engagement > Events.
- Click share in the list.
The event can take 24–48 hours to appear in standard reports. To check that it’s working right away, use Reports > Realtime while you click a share button on your site.
Register custom dimensions (one-time setup) #
To break the data down by network, tool, or post, register the parameters as custom dimensions:
- In GA4, go to Admin > Data display > Custom definitions > Create custom dimension.
- Create one custom dimension for each parameter you want to report on, with Scope: Event, using the exact parameter name from the table above (for example,
methodandsource). - Save.
Custom dimensions only collect data from the moment you create them, and can take 24–48 hours to show up. For a step-by-step example of building a report, see How to Report on Action Button Data in Google Analytics 4 — the same steps work for the share event.
For developers: the hubbub:share event #
Whether or not Send Google Analytics Events is on, Hubbub dispatches a hubbub:share CustomEvent on document for every tracked click. Its detail includes network, url, method, source, and itemId. You can listen for it to send the data to any other analytics tool:
document.addEventListener( 'hubbub:share', function ( event ) {
console.log( event.detail.network, event.detail.source );
} );
Troubleshooting #
If you don’t see share events in GA4:
- Confirm Send Google Analytics Events is turned on and saved.
- Confirm GA4 is loaded on the page with gtag. If GA4 is added through GTM or an ad partner without gtag, use a GTM trigger on the
hubbub_sharedataLayer event instead. - Test in GA4 Realtime first.
- Clear all caching on your site and test again.
