AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Analytics

skill-scayver-marketing-skills-analytics · by scayver

>

— No reviews yet
0 installs
32 views
0.0% view→install

Install

$ agentstack add skill-scayver-marketing-skills-analytics

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ✓ Network access No
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-scayver-marketing-skills-analytics)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Analytics? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Marketing Analytics: Setup, Auditing, and Optimization

Mandatory Content Standards

  • Match the output length to the task. For full audits, strategies, plans, or multi-part deliverables, write 1,500 to 10,000 words. For quick tasks, single assets, snippets, or narrow revisions, keep the output concise and provide only the useful variations, rationale, and next steps.
  • Write in a way that sounds like a knowledgeable human wrote it. No robotic or templated phrasing.
  • Use short sentences. One idea per sentence. One focus per paragraph.
  • Use active voice. Never passive constructions.
  • Address the reader directly using "you" and "your."
  • Use bullet points only when they genuinely improve readability.
  • Replace all em dashes with commas, parentheses, semicolons, or a new sentence. No hidden Unicode characters.
  • End every sentence with a period.
  • No hashtags, emojis, or asterisks.
  • No introductory or closing filler phrases such as "in conclusion," "in summary," or "in a world where."
  • No warnings, notes, or disclaimers. Stick to requested output.
  • No AI cliches: no "game-changer," "unlock," "leverage," "dive into," "delve," "cutting-edge," "transformative," "revolutionize."
  • No excessive adjectives or adverbs. Let specifics do the work.
  • No broad generalizations. Every claim tied to specific context.
  • Use specific examples, data, and scenarios.
  • Pose at least one thought-provoking question per skill.
  • Mobile-friendly: short paragraphs, clear headers, scannable.
  • Practical and actionable. Every section connects to a next step.

What This Skill Covers

This skill covers the full marketing analytics stack: tracking plans, GA4 implementation, Google Tag Manager, UTM parameters, conversion tracking, attribution, and product analytics tools like Mixpanel and Segment. It also covers diagnosing broken or missing tracking and building measurement infrastructure that connects marketing spend to business outcomes.


Why Most Marketing Analytics Are Wrong

Before covering how to build solid tracking, it is worth understanding why most companies have inaccurate analytics.

The most common problem is unstructured growth. A company launches with GA4 installed. Over three years, fifteen different people add tags, events, and pixels to the site in different ways with different naming conventions. Events fire on some pages but not others. UTMs are used inconsistently. Conversions are tracked in five different places with overlapping logic.

The result is analytics that cannot be trusted. When the data is questioned, different team members have different explanations. Decisions get made on intuition because the data is not reliable.

The second common problem is tracking what is easy to track rather than what matters. Pageviews and sessions are the default metrics because they are easy to measure. Qualified lead volume and downstream conversion rates are what actually predict revenue, but they require intentional setup.

Think about this honestly: can you right now, in five minutes, pull a number that shows what your paid search campaign contributed to closed revenue in the last 90 days? If not, your analytics infrastructure is not supporting the decisions you need to make.


The Tracking Plan: Start Here

A tracking plan is a documented specification of every event you track, why you track it, what properties it carries, and where it fires. It is the blueprint that keeps your analytics consistent as your team grows.

Every tracking plan includes these elements for each event:

Event name: use a consistent naming convention. The most common is snakecase with a verb-object structure: "formsubmitted," "trialstarted," "checkoutcompleted." Never use spaces. Never use different names for the same event in different locations.

Trigger: exactly what user action causes this event to fire? "User clicks the 'Get Started' button on the homepage" is a clear trigger. "User does something on the pricing page" is not.

Properties: what data accompanies this event? For a "formsubmitted" event, properties might include formtype, pageurl, leadsource, and utm_campaign. Document every property and its expected values.

Destination: where does this event go? GA4? Segment? Mixpanel? Facebook Pixel? All of the above? Document the destinations.

Priority: is this event a core conversion event (highest priority), a micro-conversion (medium priority), or a behavioral event for analysis (lower priority)?

Owner: who is responsible for maintaining this event's implementation?

Build your tracking plan in a shared Google Sheet or Notion document. Keep it updated whenever implementation changes. An outdated tracking plan is nearly as problematic as no tracking plan.


GA4 Implementation

Google Analytics 4 replaced Universal Analytics as Google's standard web analytics platform. It uses an event-based data model where every interaction is an event.

Core Setup Checklist

Data stream configuration: create a web data stream for your website. Confirm the measurement ID (starts with G-) matches what is installed on your site.

Data retention: GA4 defaults to 2 months of data retention. Increase this to 14 months under Admin > Data Settings > Data Retention. Do this immediately after setup. You cannot retroactively recover data beyond the retention window.

Internal traffic filtering: exclude your own team's IP addresses from data. Unfiltered internal traffic inflates your numbers and distorts behavioral data, especially on low-traffic sites. Create an IP filter under Admin > Data Streams > Configure Tag Settings > Define Internal Traffic, then activate it under Admin > Data Filters.

Cross-domain tracking: if your website spans multiple domains (your marketing site at example.com and your app at app.example.com), configure cross-domain tracking. Without it, sessions break at the domain boundary and conversions attributed to your app look like direct traffic.

Google Signals: enabling Google Signals allows GA4 to use demographic data for users signed into Google accounts and enables cross-device reporting. Enable under Admin > Data Settings > Data Collection.

Linked products: link GA4 to Google Ads for conversion import, to Google Search Console for organic search data, and to BigQuery for raw event export if you need custom analysis.

Conversion Events

GA4 does not have "goals" like Universal Analytics. Instead, you mark specific events as conversion events.

Go to Admin > Events. Find the event you want to mark as a conversion (for example, "generate_lead" or "purchase"). Toggle "Mark as conversion."

For events that do not fire automatically, you need to create them. GA4 auto-collects several events: pageview, firstvisit, sessionstart, userengagement, scroll, click, file_download. Everything else requires custom implementation.

The most important conversion events to set up for a SaaS business:

  • sign_up (completed registration)
  • trial_started
  • subscription_activated (paid conversion)
  • demo_scheduled

For e-commerce:

  • addtocart
  • begin_checkout
  • purchase (with revenue parameter)

Custom Events in GA4

Create custom events using Google Tag Manager (covered below) or by adding the gtag.js event command directly in your site code.

The gtag.js format is: gtag('event', 'eventname', { 'parametername': 'parameter_value' });

For example, tracking a form submission: gtag('event', 'formsubmitted', { 'formtype': 'contact', 'page_location': window.location.href });

Custom parameters in events are not visible in GA4 reports by default. You must register them as custom dimensions or metrics under Admin > Custom Definitions. Create a custom dimension for each parameter you want to see in reports.


Google Tag Manager

Google Tag Manager (GTM) is a tag management system that lets you add and update tracking code on your website without editing code directly for every change.

GTM operates on three concepts: tags (the tracking code that fires), triggers (the conditions that cause a tag to fire), and variables (dynamic values that tags and triggers reference).

Setting Up GTM

Create a GTM account and container at tagmanager.google.com. Install the GTM snippet on every page of your site: one snippet in the head and one snippet in the body, immediately after the opening body tag. Once GTM is installed, use it to manage all other tracking tags.

Install your GA4 tag through GTM using the Google Tag type. Enter your GA4 Measurement ID. Set the trigger to "All Pages." This replaces any direct GA4 installation.

Trigger Types

Page View trigger: fires when a page loads. Use for basic pageview tracking and for firing tags on specific pages (for example, firing a conversion event on your thank-you page).

Click trigger: fires when a user clicks an element. Configure by CSS class, element ID, or any click variable. Use to track CTA clicks, button clicks, or navigation clicks.

Form Submission trigger: fires when a form is submitted. Important: test this carefully. Some forms use JavaScript to submit without page reload, which requires a different trigger configuration.

Custom Event trigger: fires when a custom dataLayer.push() event is triggered from your site code. The most flexible and reliable method for tracking complex interactions.

Scroll Depth trigger: fires when a user scrolls to a specified percentage of a page. Use to measure content engagement.

Timer trigger: fires after a specified amount of time on the page. Use to detect engaged sessions vs. bounces with timing nuance.

The Data Layer

The data layer is a JavaScript array (window.dataLayer) that your site uses to pass information to GTM. When your site triggers an event, it pushes an object to the data layer. GTM reads the data layer and fires the appropriate tags.

The data layer is the most reliable way to pass custom information to your tags. If your site knows a user's plan type, account ID, or order value, push that information to the data layer and read it in GTM with a Data Layer Variable.

A typical dataLayer push looks like: window.dataLayer.push({ 'event': 'trialstarted', 'plantype': 'pro', 'user_id': '12345' });

Configure a Data Layer Variable in GTM to read plantype and userid, then pass those values as parameters in your GA4 event tag.

Debugging GTM

Use GTM Preview mode (the Debug button in the GTM interface) to test your implementation before publishing. Preview mode shows you exactly which tags fire on each page, which triggers activated them, and what variable values they received.

Use GA4's DebugView (Admin > DebugView) simultaneously. DebugView shows real-time events as they fire from your browser. This combination lets you verify that GTM tags are firing and that GA4 is receiving the events correctly.


UTM Parameters

UTM parameters are the query string parameters that attribute website traffic to specific campaigns. They are the foundation of cross-channel marketing attribution.

The five UTM parameters:

utm_source: the platform or channel sending traffic. Examples: google, facebook, linkedin, newsletter, partner.

utmmedium: the channel type. Examples: cpc (paid search), paidsocial, email, organic, referral.

utm_campaign: the specific campaign. Use a consistent naming format: "q1-2025-brand-awareness" or "competitor-brand-nov24."

utm_content: differentiates ads within a campaign. Use to distinguish ad variations or different placements.

utm_term: the keyword for paid search campaigns. Often populated automatically by Google Ads.

UTM Naming Conventions

Inconsistent UTM naming is one of the most common analytics problems. If one person uses utmsource=Facebook and another uses utmsource=facebook, they create two separate traffic sources in GA4 that should be the same.

Establish and document a naming convention before you start. Common rules:

  • Use lowercase only
  • Use hyphens instead of spaces or underscores (GA4 handles hyphens cleanly)
  • Keep campaign names concise but descriptive
  • Use consistent abbreviations (cpc not paid-search, email not newsletter)

Build a UTM builder spreadsheet or use a tool like Google's Campaign URL Builder. Never let individuals create UTM parameters from memory.

Audit your UTM usage quarterly. In GA4, go to Acquisition > Traffic Acquisition and filter by session_campaign. Look for near-duplicate campaign names that should be unified.

Auto-Tagging vs. Manual UTMs for Google Ads

Google Ads auto-tagging (gclid parameter) is the preferred method for Google Ads attribution. It passes more data than manual UTMs and links directly to your Google Ads account when you have GA4 linked.

Do not use both auto-tagging and manual UTMs on the same Google Ads URLs. They conflict. Use auto-tagging for Google Ads and reserve manual UTMs for all other channels.


Attribution Setup

Attribution determines how credit for conversions is assigned across touchpoints in the customer journey.

GA4's default attribution model is data-driven, which uses Google's algorithm to assign fractional credit. You can change this under Admin > Attribution Settings.

For most marketing teams, the most important attribution setup decision is not which model to use in GA4 but whether to rely solely on GA4 or to add a multi-touch attribution layer.

Limitations of GA4 Attribution

GA4 attribution is session-based and limited to what the GA4 tag observes. It cannot see:

  • Offline touchpoints (sales calls, events, in-person interactions)
  • Cross-device journeys with gaps in user ID continuity
  • Dark social traffic (links shared in Slack, WhatsApp, or private messages that arrive as direct)
  • Channels where GA4 is blocked by ad blockers or iOS privacy restrictions

The actual traffic contribution of channels like newsletters, podcasts, and dark social is consistently underreported in GA4.

Multi-Touch Attribution Tools

For accurate multi-channel attribution, especially at scale, consider adding a dedicated attribution tool:

Triple Whale: focused on e-commerce, integrates with Shopify, and provides pixel-based attribution with north star metrics.

Northbeam: multi-touch attribution with media mix modeling. Strong for direct-to-consumer brands.

Rockerbox: centralizes attribution data from all channels into a unified view. Good for blended media buyers.

HockeyStack: covers both paid and organic attribution, with good B2B support.

These tools require connecting your ad platform APIs and often your CRM. The setup investment pays back in clearer understanding of which channels drive real pipeline and revenue.


Product Analytics: Mixpanel and Segment

GA4 tracks website behavior. For understanding user behavior inside your product (for SaaS and app companies), you need a product analytics tool.

Segment

Segment is a Customer Data Platform (CDP) that sits between your product and your analytics tools. Instead of installing Mixpanel, Amplitude, Intercom, and other tools separately in your codebase, you install Segment once. Segment then routes events to any destination you configure.

The benefit is data consistency. Every downstream tool receives the same event data from a single source. If you rename an event or add a property, you change it in Segment and it propagates to all destinations.

Set up Segment by installing the analytics.js library (or the iOS/Android SDK for mobile). Then track events using Segment's track() method: analytics.track('Trial Started', { plan: 'pro', signupsource: 'pricingpage' });

Configure destinations in the Segment dashboard. Add Mixpanel, GA4, Intercom, HubSpot, Salesforce, or any other tool you use. Segment sends each event to all configured destinations.

Mixpanel

Mixpanel is an event-based analytics tool with powerful funnel analysis, cohort analysis, and user-level reporting. It is particularly valuable for understanding how users move through your product and where they drop of

…

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.