Skip to main content

Google Analytics Setup Guide for TanaFlows Theme

This document provides a comprehensive list of key CSS Selectors (Classes and IDs) in the TanaFlows theme, allowing you or your development team to easily configure custom Event Tracking using Google Tag Manager (GTM) or Google Analytics 4 (GA4).


1. CSS Selectors Reference for Event Tracking

Below are the main interactive elements on the theme and their corresponding selectors to use as firing conditions (Triggers) in GTM:

Area / ComponentUser ActionTarget CSS SelectorRecommended Event Name (GA4)Notes / Collected Event Parameters
HeaderClick main CTA buttona.btn-menuheader_cta_clickThe primary registration or call-to-action button in the header’s right corner.
Click Search icon.btn-searchsearch_openTracks how often users click to open the search overlay.
Switch language.language-dropdown-triggerlanguage_switchTracks reader language-switching behaviors.
Toggle Dark Modebutton.dark-mode-toggletheme_toggle_clickTracks light/dark interface switching behaviors.
Biolink PageClick biolink list buttona.biolink-btnbiolink_link_clickPrimary buttons in the Biolink list. Can collect Click URL and Click Text.
Click Hero CTAa.hero-cta-buttonbiolink_hero_cta_clickThe prominent CTA button located in the Hero section of the author page.
Click social icons.author-social-linkbiolink_social_clickAuthor’s social media links (Facebook, Twitter, GitHub, etc.).
Click back to homea.author-nav-back-linkbiolink_back_homeTracks users exiting the biolink page back to the blog.
Product PageClick Buy Nowa.product-btn-primary.lemonsqueezy-buttonproduct_buy_clickThe main checkout checkout button (e.g., Lemon Squeezy, Gumroad).
Click View Live Demoa.product-btn-secondary#live-demoproduct_demo_clickThe button to preview the product live demo.
Click Testimonial URL.product-sidebar-box aproduct_testimonial_web_clickClick on the personal website link of the testimonial author.
Course PageClick to unlock lessonbutton[data-portal="signup/free"]course_unlock_clickLogged-out users clicking the CTA to unlock the lesson.
Click start/resumebutton containing @click*="setCurrentLesson"course_start_clickClicks the “Start Now” or “Continue” action buttons on a course.
Select lesson in sidebara.course-lesson-btncourse_lesson_selectSwitching lessons via the sidebar. Collects Click Text (lesson title).
Click Next Lessonbutton containing @click="nextLesson"course_next_lessonClicking the next lesson button at the end of the content.
Click Previous Lessonbutton containing @click="previousLesson"course_prev_lessonClicking the previous lesson button at the end of the content.
Newsletter / FormSubmit subscription formForm: .subscribe-form or Button: form button[type="submit"]newsletter_signupReaders successfully completing the newsletter signup form.

2. Step-by-Step Google Tag Manager (GTM) Configuration Guide

To track any button from the list above using GTM, follow these standard steps:

Step 1: Enable Default Click Variables

  1. Go to your GTM workspace > Variables > click Configure in the Built-In Variables panel.
  2. Check all variables under the Clicks section (including: Click Element, Click Classes, Click ID, Click Target, Click URL, Click Text).

Step 2: Create a Button Click Trigger

Example: Tracking clicks on the Buy Now button on your product pages:

  1. Go to Triggers > Click New.
  2. Name the trigger: Click - Product Buy Button.
  3. Select trigger type: Click - All Elements (or Just Links).
  4. Under “This trigger fires on”, select: Some Clicks.
  5. Set the firing condition:
    • Click Classes contains product-btn-primary
    • (Alternatively: Click Element matches CSS selector a.product-btn-primary.lemonsqueezy-button).
  6. Click Save.

Step 3: Configure the GA4 Event Tag

  1. Go to Tags > Click New.
  2. Name the tag: GA4 Event - Product Buy Click.
  3. Select tag configuration: Google Analytics > Google Analytics: GA4 Event.
  4. Select your GA4 Configuration Tag (or enter your Measurement ID).
  5. Set Event Name to: product_buy_click.
  6. (Optional) Add Event Parameters to send additional context:
    • Parameter Name: product_name | Value: Choose the {{Page Title}} variable (or type a custom name) to identify which product was clicked.
  7. Under the Triggering section: Select the Click - Product Buy Button trigger created in Step 2.
  8. Click Save, then click Submit to publish your changes.