How to Track Custom Button Clicks in GA4 on Blogger (Without Google Tag Manager)
Standard GA4 setup is great for tracking overall page views, but it falls short when you need to know whether someone took a valuable action, like clicking a "Start My Free Course" button or submitting a lead form.
To truly measure your blog's success and optimize for Google Ads, you need to track these specific conversions, now called Key Events in GA4.
In this guide, I will show you exactly how to track custom button clicks on your Blogger site using a simple HTML snippet. No complex external tools or additional containers like Google Tag Manager are required.
Step 1: Prepare the Tracking Command
In Google Analytics 4, every action needs a specific "ping" to tell the system that it happened. For lead generation (like signing up for a course or a newsletter), the standard event name is generate_lead.
Here is the exact code snippet you will need to add to your button:
onclick="gtag('event', 'generate_lead', {'form_name': 'master_seo_course'});"
Note: You can change 'master_seo_course' to whatever name makes sense for your specific form.
Step 2: Add the Code to Your Blogger HTML
Now, we need to inject that tracking command directly into your website's code.
Log in to your Blogger dashboard.
Go to Theme and click Edit HTML.
Click anywhere inside the code editor and press
Ctrl+F(orCmd+Fon Mac) to search for your specific button text (for example, "Start My Free Course").Once you find your button's HTML tag, carefully paste the tracking command inside it.
Before:
<button class='submitBtn' type='submit'>Start My Free Course</button>
After:
<button class='submitBtn' type='submit' onclick="gtag('event', 'generate_lead', {'form_name': 'master_seo_course'});">Start My Free Course</button>
Click the Save icon at the top right of your Blogger editor.
Step 3: Test Your Tracking Like a Pro
You don't want to wait until tomorrow to see if your code works. Here is how to test it immediately:
Open a new Incognito window in your browser and go to your live blog. Testing in incognito ensures your own admin session or ad blockers don't block the tracking script.
Click the button you just modified (and submit the form if necessary).
Open your GA4 account and navigate to Reports > Realtime.
Scroll down to the Event count by Event name card.
Within 10 to 30 seconds, you should see your new generate_lead event pop up in the list!
Step 4: Mark it as a Key Event (The 24-Hour Rule)
This is the crucial final step that most tutorials skip. You need to tell GA4 that this specific event is a valuable business conversion, not just a random click.
Because you just fired this event for the first time, GA4 needs about 24 hours to process it into your standard reports.
Wait one day, then follow these steps:
In your GA4 dashboard, click the Admin gear icon in the bottom left corner.
Under the "Data display" menu, click on Events.
Click on the Recent events tab (right next to the Key events tab).
Find
generate_leadin your list of events.Click the star icon next to it so it turns blue.
By starring this event, it is now an official Key Event. When you eventually link your GA4 to Google Ads, this is the exact metric the algorithm will use to optimize your campaigns, find you more leads, and grow your audience.
Frequently Asked Questions
Do I need Google Tag Manager to track button clicks in GA4?
No, you do not need Google Tag Manager. You can track custom button clicks directly in GA4 by adding a simple onclick tracking command (like gtag('event', 'generate_lead');) straight into your website's HTML code.
How long does it take for a new custom event to show up in GA4?
While you can see the event trigger almost immediately in the GA4 Realtime report, it typically takes up to 24 hours for a new custom event to fully process and appear in your standard GA4 Events list.
How do I mark an event as a Key Event (Conversion) in GA4?
Once your event populates in the GA4 'Recent events' list (usually 24 hours after it first fires), simply click the star icon next to the event name so it turns blue. This officially marks it as a Key Event for your analytics and Google Ads campaigns.
How can I test if my GA4 event tracking is working?
The most accurate way to test your tracking is to open your live website in an Incognito window, click the button you modified, and then watch the 'Event count by Event name' card in your GA4 Realtime report. Your custom event should appear within 10 to 30 seconds.
Want More Traffic & Leads?
Get a custom SEO & AI growth strategy for your business. No guesswork, just real results.
Get Your Free Strategy
Comments
Post a Comment