Analytics and Data Insights
Learn how to leverage data and analytics to make informed marketing decisions.
Content
Setting Up Analytics
Versions:
Watch & Learn
AI-discovered learning video
Sign in to watch the learning video for this topic.
Setting Up Analytics — The No-BS Launch Plan (GA4, GTM, Mobile-ready)
"If your analytics setup is a house, you want it built on rock, not on a pile of sticky notes and wishful thinking." — Your future self after debugging a missing conversion
You already saw the big picture in Introduction to Analytics and got cozy with Google Analytics in Google Analytics Overview. Now we build. This is the gritty, practical session where we stop theorizing and actually wire the place so the data flows — including the mobile traffic you were optimizing in Mobile Marketing.
Why this matters (quick reminder)
Skipping a proper setup means: bad data, bad decisions, and marketing teams blaming the moon. A correct setup gives you clean signals for attribution, mobile engagement tracking, and product optimization.
This guide assumes you know analytics concepts (users, sessions, events) from the previous modules. We focus on implementation: accounts, tags, events, testing, and privacy — with mobile-first thinking.
Step 1 — Choose your stack (short and decisive)
- Primary: Google Analytics 4 (GA4). It’s where Google is headed; better for event-based tracking and cross-platform measurement.
- Tag manager: Google Tag Manager (GTM) for web. Use Firebase + GA4 for native mobile apps (or GTM for mobile if you're adventurous).
Why GTM? It lets marketers add or change tags without a dev sprint. Why Firebase? It’s the GA4-native solution for apps.
Step 2 — Account, Property, Data Streams (the skeleton)
- Create or use your Google account.
- Create a GA4 Property.
- Add Data Streams: one for Web, one for Android app, one for iOS app (if applicable).
- Configure basic settings: default URL, timezone, and currency.
Tip: name your property and streams with a clear convention: brand-environment-platform (eg. 'Acme-Prod-Web', 'Acme-Staging-iOS'). Humans and teammates will thank you.
Step 3 — Install the tag (GTM or gtag)
Recommended: use GTM for flexibility. If you need the direct snippet, here's the minimalist gtag snippet for GA4 (replace MEASUREMENT_ID):
<!-- Global site tag (gtag.js) -->
<script async src='https://www.googletagmanager.com/gtag/js?id=MEASUREMENT_ID'></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'MEASUREMENT_ID', { 'send_page_view': false }); // we control page_view via GTM
</script>
If you use GTM, place the GTM container snippet site-wide and create a GA4 Configuration tag.
Step 4 — Measurement plan & naming conventions (the brain)
Before you blind-fire events, create a measurement plan:
- Objective (eg. 'Increase mobile signups')
- KPIs (eg. 'Signups', 'Add-to-cart', 'Checkout completed')
- Events to track (detailed below)
- Parameters to attach (eg. 'product_id', 'value', 'campaign')
Naming conventions (consistency saves lives):
- Events: lowercase_snake_case (eg. 'add_to_cart', 'app_install')
- Parameters: param_name (eg. 'product_id')
- Conversion names: 'conv_signup' or 'purchase_usd'
Step 5 — Events you should deploy (especially for mobile)
High-impact events to track across web + mobile:
- page_view / screen_view
- session_start
- first_open / app_install (mobile)
- user_engagement (or engagement_time_msec)
- click_to_call (mobile web)
- add_to_cart, remove_from_cart
- begin_checkout, purchase
- sign_up, login
- deep_link_open (track deep link attribution)
For mobile apps (Firebase GA4): also capture
- in_app_purchase
- tutorial_complete, level_up (if you have gamified flows)
Attach meaningful parameters: product_id, category, value, currency, campaign_source.
Step 6 — Conversions and audiences
- Mark high-value events as conversions in GA4 (eg. purchase, signup).
- Create audiences for remarketing and analysis (eg. 'mobile_last_7d_add_to_cart_no_purchase').
Remember: GA4 is event-driven — pick a few high-value conversions and track them accurately.
Step 7 — Test, test, debug
- Use GTM Preview Mode for web.
- Use GA4 DebugView (via SDK debug configuration or the GA4 Debug Chrome extension).
- QA checklist:
- Events fire once per action (no duplicates)
- Correct parameters sent
- Conversions recorded in real time
- Mobile attribution (from deep links or campaigns) resolves correctly
If you see weird spikes, revert to the last known-good tag configuration and debug step-by-step.
Step 8 — Privacy & data governance
- Implement consent management (CMP) if you serve EU/UK users.
- Configure data retention settings in GA4.
- Mask PII: never send emails, phone numbers, or personal IDs as event parameters.
Quote to remember:
"Consent isn't a checkbox; it's how you keep your product legal and your team out of a PR crisis."
Quick comparisons: GA4 vs Universal Analytics (setup-wise)
| Topic | GA4 | Universal Analytics (UA) |
|---|---|---|
| Model | Event-based | Session + hit-based |
| Views | No views (use comparisons/filters) | Views available |
| Mobile apps | Native via Firebase | Requires SDK workarounds |
| Recommended setup | GA4 + GTM (+ Firebase for apps) | UA + GTM |
If you upgraded from UA, keep both running during the migration, but prioritize GA4 for new features.
Launch checklist (copy-paste and run)
- GA4 property created
- Data streams added (web + mobile)
- GTM container deployed site-wide
- Measurement plan documented
- Core events instrumented and parameterized
- Conversions defined
- DebugView/Preview QA complete
- Consent & data retention configured
- Naming conventions enforced
Closing: TL;DR + a little pep talk
Setting up analytics well is boring in the short term and heroic in the long term. Do the messy work — naming, planning, testing — and you'll get clean signals that make your mobile campaigns and web optimizations actually work. Remember: events are your new currency; treat them with respect.
Go deploy this setup, then come back smug and show the team the data that proves your hypothesis about mobile users. You're not just tracking clicks — you're building the map to where the customers actually are.
Version note: if you're also tracking mobile app installs from those tasty deep-linking campaigns we discussed in Mobile Marketing, prioritize deep_link_open and first_open events in your measurement plan.
Happy tagging. May your data be clean and your debug logs mercifully short.
Comments (0)
Please sign in to leave a comment.
No comments yet. Be the first to comment!