Summary
Google Analytics is a powerful tool for understanding your website’s performance and user behavior. Setting up tracking correctly and configuring key events can provide actionable insights to grow your online presence. In this guide, we’ll walk you through the simple steps to set up Google Analytics tracking and highlight the main events you should create to maximize its value.
Why Use Google Analytics?
Google Analytics helps you track visitor data, monitor engagement, and optimize your website. From page views to conversions, it offers a clear picture of how users interact with your site. Setting it up is easier than you think, and creating events allows you to track specific actions, like button clicks or form submissions.
Step-by-Step Guide to Set Up Google Analytics Tracking
Follow these steps to get Google Analytics up and running on your website quickly.
1. Create a Google Analytics Account
• Visit analytics.google.com and sign in with your Google account.
• Click “Start measuring” and set up an account name (e.g., your business name).
• Create a property for your website by entering its name, URL, industry, and time zone.
• Choose your data-sharing settings and accept the terms.
2. Get Your Tracking Code
• After setting up your property, Google Analytics will create a web data stream with a Measurement ID (G-XXXXXXX).
• In the data stream, open “View tag instructions” to get the Google tag (gtag.js) snippet, or use Google Tag Manager.
• Copy this code—it’s what connects your website to Google Analytics.
3. Add the Tracking Code to Your Website
• WordPress Users: Use a plugin like “MonsterInsights” or “Site Kit by Google” for easy setup. Alternatively, add the snippet with a header-code plugin or a child theme (not the parent theme’s header.php, which is overwritten on update).
• Other Platforms: Add the tracking code to the <head> section of every page on your site. If you use a CMS like Shopify or Wix, look for a Google Analytics integration in the settings.
• Verify the code is working by checking the “Real-Time” report in Google Analytics.
4. Set Up Events and Key Events (GA4)
In GA4, events are the primary way to track user interactions. Some events, like page views, are tracked automatically. With enhanced measurement turned on, GA4 also collects scrolls, outbound clicks, site search, video engagement and file downloads without extra code. Custom events cover the rest. Mark the events that matter most as key events.
Main Events to Create in Google Analytics
Events in GA4 help you track specific actions users take on your site. By setting up key events, including e-commerce actions and funnel tracking, you can measure meaningful interactions and optimize your conversion funnel. Below is a comprehensive list of events to set up, including critical e-commerce steps and additional engagement metrics to give you a complete picture of user behavior.
1. Button Clicks
- Why? Track clicks on important buttons like “Buy Now,” “Sign Up,” or “Download.”
- How? Use Google Tag Manager (GTM) to create a trigger for button clicks. Add a tag with the event name (e.g., “button_click”) and parameters like button text or ID.
- Example: Measure how many users click your “Add to Cart” button.
2. Form Submissions
- Why? Forms are critical for lead generation (e.g., contact forms, newsletter signups).
- How? Set up an event to trigger when a form is submitted. In GTM, create a trigger for form submissions and assign an event name like “form_submit.”
- Example: Track how many users complete a “Request a Quote” form.
3. Video Plays
- Why? Understand how users engage with your video content.
- How? For YouTube embeds, GA4 enhanced measurement already sends video_start, video_progress and video_complete. Use GTM only for other players, with parameters for video title or duration.
- Example: Measure how many users watch your product demo video.
4. Scroll Depth
- Why? See how far users scroll on your pages to gauge content engagement.
- How? GA4 enhanced measurement already sends a “scroll” event when 90% of the page becomes visible. Use a GTM scroll depth trigger (e.g., 25%, 50%, 75%) only if you need other thresholds.
- Example: Track how many users reach the bottom of your blog posts.
5. File Downloads
- Why? Monitor downloads of PDFs, eBooks, or other files.
- How? GA4 enhanced measurement already collects “file_download” for common file extensions (e.g., .pdf, .docx). Don’t send a second “file_download” from GTM, or downloads will be counted twice.
- Example: Track how many users download your free guide.
6. Add to Cart
- Why? Track when users add products to their shopping cart, a key step in the e-commerce funnel.
- How? In GTM, create a trigger for clicks on “Add to Cart” buttons and push GA4’s recommended “add_to_cart” event with parameters like product ID, name, and price.
- Example: Measure how many users add a specific product, like a “Blue Widget,” to their cart.
7. Remove from Cart
- Why? Understand when users remove items, helping identify friction points in the purchase process.
- How? Set up a GTM trigger for “Remove from Cart” button clicks. Use an event name like “remove_from_cart” with parameters for product details.
- Example: Track how often users remove items like “Red Widget” before completing a purchase.
8. Begin Checkout
- Why? Monitor users who start the checkout process to analyze funnel progression.
- How? Use GA4’s recommended ecommerce events or create a GTM trigger for the checkout page load or button click. Set an event name like “begin_checkout” with parameters for cart value or item count.
- Example: Track how many users reach the checkout page after adding items to their cart.
9. Purchase
- Why? Track completed purchases to measure revenue and conversion rates.
- How? Push GA4’s recommended ecommerce events or set up a GTM trigger for the order confirmation page. Set an event name like “purchase” with parameters like order ID, total value, and products purchased.
- Example: Measure how many users complete a purchase and the total revenue from a specific campaign.
10. Funnel Analysis (No New Event Needed)
- Why? Funnels map the user journey through key steps (e.g., product view > add to cart > checkout > purchase) to identify drop-off points and optimize conversions.
- How? In GA4, create a funnel exploration report using events like “view_item,” “add_to_cart,” “begin_checkout,” and “purchase.” A funnel is a report built from these events, not an event of its own.
- Example: Analyze how many users drop off between “add_to_cart” and “begin_checkout” to improve your checkout process.
11. Outbound Link Clicks
- Why? Track clicks on links leading to external sites (e.g., affiliate links, partner sites) to measure referral traffic.
- How? GA4 enhanced measurement already sends a “click” event with outbound = true for links that leave your domain. Only build a GTM tag if you need extra details.
- Example: Track how many users click an affiliate link to an external product page.
12. Search Queries
- Why? Understand what users search for on your site to improve content and product discoverability.
- How? Turn on Site search in enhanced measurement (event “view_search_results”, parameter search_term), or send the recommended “search” event from GTM.
- Example: Track how many users search for “winter jacket” on your e-commerce site.
13. Etc, etc, etc
Add any other event that matters for your business.
Another example could be a exchange, refund or return of a product from your e-commerce website.
Tips for Success
- Test Your Events: Use GA4’s “DebugView” or GTM’s preview mode to ensure all events, including e-commerce and funnel steps, are firing correctly.
- Implement GA4 Ecommerce Events: No setting collects them automatically. Your site (or its GA4 plugin) must push add_to_cart, begin_checkout, purchase… with items, value and currency.
- Analyze Funnels Regularly: Use GA4’s funnel reports to identify where users drop off and test changes to improve conversions.
- Stay Compliant: Ensure you have a cookie consent banner and comply with GDPR or CCPA regulations when tracking user actions.
Conclusion
Setting up Google Analytics tracking is straightforward, and creating key events unlocks valuable insights into user behavior. By tracking key interactions and the ecommerce funnel (view_item → add_to_cart → begin_checkout → purchase), you can measure what matters most to your business. Follow the steps above, test your setup, and start leveraging data to improve your website’s performance today!
Related reading
- Why Your GA4 Custom Dimensions Show ‘(not set)’ (And How to Fix It)
- Tag Commander Multi-Container: Why Your Variables Show ‘Unset’ (A Complete Timing Breakdown)
- GA4 Events Explained – Full Overview + Ecommerce Funnel with Real Examples
- Understanding Google Signals in Google Analytics 4: How It Works and a Use Case with Demographic Data