home / blog / analytics setup guide...
Analytics & Reporting

Analytics Setup Guide

IB
Isaac Benyakar
Invalid Date
10 min read

Step-by-step configuration for Google Analytics 4 and Search Console, including event tracking code and conversion value setup.

Share:

Google Analytics 4 Setup

  1. Create Property: Go to Admin → Create Property ("Isaac Benyakar - Main Site").
  2. Data Stream: Select "Web", enter URL, and enable "Enhanced measurement".
  3. Get ID: Copy the Measurement ID (G-XXXXXXXXXX).
  4. Install: Add the code below to your site's <head>.
Astro Integration

---
// src/components/analytics/GoogleAnalytics.astro
const GA_MEASUREMENT_ID = import.meta.env.PUBLIC_GA_MEASUREMENT_ID;
---

<!-- Google tag (gtag.js) -->
<script async src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}></script>
<script define:vars={{ GA_MEASUREMENT_ID }}>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', GA_MEASUREMENT_ID);
</script>
    

Event Tracking Setup

Track key user actions to measure engagement and lead generation.

1. Free Audit Request

generate_lead
  • form_name: "free_audit_request"
  • value: 4800

2. Phone Click

phone_call_click
  • phone_number: "+1-..."
  • value: 1000

Implementation Code

// Track Phone Clicks
document.querySelectorAll('a[href^="tel:"]').forEach(link => {
  link.addEventListener('click', () => {
    gtag('event', 'phone_call_click', {
      'phone_number': link.getAttribute('href')
    });
  });
});
    

Google Search Console Setup

STEP 1

Verification

Verify domain ownership via DNS record (TXT) or HTML file upload.

STEP 2

Sitemap Submission

Submit https://isaacbenyakar.com/sitemap.xml and check for success status.

Conversion Configuration

Assign monetary values to understand ROI.

Event Name Conversion Type Est. Value
generate_lead Audit Request $4,800
phone_call_click Inbound Call $1,000
form_submit Contact Form $2,000

Custom SEO Dashboard

Create a focused view in GA4 "Explore" tab:

  • Filter: Session source / medium includes "organic"
  • Dimensions: Landing Page, Device Category
  • Metrics: Sessions, Engagement Rate, Key Events

Monthly Monitoring Checklist

Google Analytics

  • Organic traffic trend (MoM)
  • Top 10 landing pages
  • Conversion rate by device

Search Console

  • Impression growth
  • New keyword rankings
  • Fix 404/Server errors
IB

About Isaac Benyakar

Full-stack developer and SEO engineer based in Miami. I help businesses dominate their markets through custom web development and technical SEO. 347% average traffic growth. Zero compromises.

STAY_UPDATED

Get SEO & Dev Insights

No fluff. No spam. Just real strategies, case studies, and technical breakdowns delivered monthly.

WORK_WITH_ME

Need Professional Implementation?

I don't just write about SEO and development—I execute. Get a free audit and see what's possible.