StarDomain

Adding Google Analytics to Your Website

Adding Google Analytics to Your Website

Track visitor behavior, traffic sources, and site performance with Google Analytics.

Step 1: Create a Google Analytics Account

  1. Go to analytics.google.com
  2. Click Start measuring
  3. Create an account and property
  4. Enter your website URL
  5. Get your Measurement ID (starts with G-)

Step 2: Add the Tracking Code

Copy the Global Site Tag (gtag.js) and paste it into the head section of every page.

WordPress

  1. Install the Site Kit by Google plugin
  2. Connect your Google account
  3. The plugin adds tracking code automatically

Or use Insert Headers and Footers plugin to paste the code manually.

Verify Installation

  • In Google Analytics → Realtime → visit your site
  • You should see yourself as an active user
  • Full data appears within 24-48 hours

Key Reports

  • Acquisition: Where visitors come from
  • Engagement: What pages they visit
  • Retention: How often they return
  • Conversions: Goal completions

Privacy Note

If you serve EU visitors, display a cookie consent banner that mentions analytics tracking.