Token导航 LogoToken导航TokenDH.com
开发操作浏览器github未标认证来源可访问许可证需确认审计通过

analytics-integration分析整合

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

624

周安装

25

GitHub Stars

19

下载量

202
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:analytics-integration(分析整合)
来源仓库:https://github.com/finsilabs/awesome-ecommerce-skills
仓库路径:skills/analytics-integration
安装命令:
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill analytics-integration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/finsilabs/awesome-ecommerce-skills --skill analytics-integration

简介

搭建电商级分析栈,集成 GA4、Meta Pixel 与 GTM 实现端到端追踪。

  • 设计结构化数据层与服务器端标签,提升事件准确性与浏览器限制规避。
  • 同步部署 Conversions API 增强广告归因可靠性。
  • 需配置容器环境变量与权限,确保第三方平台授权合规。
  • analytics-integration 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Analytics Integration

Overview

Implement a robust analytics stack for e-commerce using Google Analytics 4 (GA4), Meta Pixel, and Google Tag Manager (GTM). Covers structured data layer design for product and checkout events, server-side tagging via GTM server containers to improve data accuracy and bypass browser restrictions, and Meta Conversions API for reliable ad attribution.

When to Use This Skill

  • When adding GA4 e-commerce tracking (product views, add-to-cart, checkout steps, purchase) to a new or existing store
  • When implementing Meta Pixel alongside the Conversions API for dual-mode event delivery to improve ad attribution
  • When migrating a GTM web container to a server-side container for better data control and cookie lifespans
  • When troubleshooting missing or duplicate conversion events caused by ad blockers or client-side failures
  • When meeting privacy requirements that mandate server-side deduplication between browser and server events

Core Instructions

Step 1: Determine your platform and recommended approach

PlatformRecommended Analytics SetupKey Actions
ShopifyBuilt-in GA4 integration + GTM appConnect GA4 in Online Store → Preferences → Google Analytics; install GTM4WP or the official Google & YouTube channel app for Meta Pixel
WooCommerceMonsterInsights plugin for GA4 + GTMInstall MonsterInsights (free tier or Pro from $99/yr) for GA4; install WooCommerce Google Analytics Integration (free) for enhanced e-commerce events
BigCommerceNative GA4 integration + channel managerConnect GA4 in Advanced Settings → Data Solutions → Google Analytics; use BigCommerce's Meta Pixel integration under the Channel Manager
Custom / HeadlessGTM container + server-side container + custom data layerImplement a canonical data layer, deploy GTM server container on Cloud Run or Vercel, and add Meta Conversions API from your backend

Step 2: Platform-specific analytics setup


Shopify

Connect GA4 (built-in, no code required):

  1. Go to Online Store → Preferences → Google Analytics
  2. Click Connect your Google account and select your GA4 property
  3. Shopify sends all standard e-commerce events automatically: page_view, view_item, add_to_cart, begin_checkout, purchase
  4. In Google Analytics → Configure → Events, mark the purchase event as a conversion

Track checkout funnel with GA4 Explorations:

  1. In GA4, go to Explore → Funnel exploration
  2. Create funnel steps:

- Step 1: begin_checkout event - Step 2: add_shipping_info event - Step 3: add_payment_info event - Step 4: purchase event

  1. This shows exactly where shoppers drop off in checkout

Add Meta Pixel:

  1. Go to the Shopify App Store and install the Meta channel app (free)
  2. Follow the setup wizard to connect your Facebook Business account
  3. Meta sends pixel events automatically through the Shopify integration, including the Conversions API for server-side deduplication

WooCommerce

Install MonsterInsights for GA4:

  1. Install MonsterInsights from wordpress.org (free tier available; Pro from $99/year adds enhanced e-commerce)
  2. Go to Insights → Settings → General and connect your GA4 property
  3. Enable Enhanced eCommerce Tracking in the MonsterInsights settings — this sends add_to_cart, begin_checkout, and purchase events to GA4 with product-level data

Add Meta Pixel:

  1. Install PixelYourSite (free tier available, pro from $69/year) from wordpress.org
  2. Enter your Pixel ID and connect via Facebook's Business Integration
  3. PixelYourSite includes the WooCommerce extension for ViewContent, AddToCart, InitiateCheckout, and Purchase events

Verify events are firing:

  1. Install the Meta Pixel Helper Chrome extension
  2. Visit your product page and checkout — the extension shows which events fire on each page
  3. In GA4, use Admin → DebugView to confirm events arrive in real time

BigCommerce

Connect GA4 (built-in):

  1. Go to Advanced Settings → Data Solutions → Google Analytics
  2. Enter your GA4 Measurement ID (format: G-XXXXXXXX)
  3. BigCommerce fires e-commerce events automatically including purchase with full order data

Add Meta Pixel:

  1. Go to Channel Manager → Marketplace → Meta
  2. Connect your Facebook Business account
  3. BigCommerce sends Pixel events natively and supports the Conversions API for server-side deduplication

Custom / Headless

Design a canonical data layer first — every event follows the same shape regardless of which vendor consumes it:

// dataLayer must be initialized in <head> before GTM loads
window.dataLayer = window.dataLayer || [];

// Always clear ecommerce before pushing a new event (prevents GTM from merging stale items)
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
  event: 'add_to_cart',
  ecommerce: {
    currency: 'USD',
    value: product.price * quantity,
    items: [{
      item_id: product.sku,
      item_name: product.name,
      item_brand: product.brand,
      item_category: product.category,
      price: product.price,
      quantity,
    }],
  },
});

Purchase event (fire after order confirmed, use server-generated order ID as transaction_id):

window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
  event: 'purchase',
  ecommerce: {
    transaction_id: order.id,  // Must be unique — deduplicate browser + server events
    value: order.total,
    tax: order.tax,
    shipping: order.shippingCost,
    currency: order.currency,
    coupon: order.couponCode || '',
    items: order.lineItems.map(line => ({
      item_id: line.sku,
      item_name: line.name,
      price: line.unitPrice,
      quantity: line.qty,
    })),
  },
});

Meta Pixel with Conversions API deduplication — send the same event from browser and server using a shared event_id:

// Browser — pass event_id for deduplication
const eventId = `purchase_${order.id}`;
fbq('track', 'Purchase', {
  value: order.total,
  currency: order.currency,
  content_ids: order.lineItems.map(l => l.sku),
  content_type: 'product',
}, { eventID: eventId });

// Send eventId to server for the Conversions API mirror
await fetch('/api/analytics/meta-purchase', {
  method: 'POST',
  body: JSON.stringify({ orderId: order.id, eventId }),
});
// Server-side Conversions API (Node.js)
import { ServerEvent, EventRequest, UserData, CustomData } from 'facebook-nodejs-business-sdk';

export async function sendMetaPurchase(order, eventId, userAgent, ipAddress) {
  const userData = new UserData()
    .setEmail(order.customerEmail)  // Automatically hashed by SDK
    .setClientIpAddress(ipAddress)
    .setClientUserAgent(userAgent);

  const customData = new CustomData()
    .setValue(order.total)
    .setCurrency(order.currency)
    .setContentIds(order.lineItems.map(l => l.sku));

  const serverEvent = new ServerEvent()
    .setEventName('Purchase')
    .setEventTime(Math.floor(Date.now() / 1000))
    .setUserData(userData)
    .setCustomData(customData)
    .setEventId(eventId)   // Matches browser eventID — Meta deduplicates automatically
    .setActionSource('website');

  await new EventRequest(process.env.META_ACCESS_TOKEN, process.env.META_PIXEL_ID)
    .setEvents([serverEvent])
    .execute();
}

Initialize Google Consent Mode v2 (required for EU traffic as of March 2024):

// Must run BEFORE GTM or gtag.js loads
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

gtag('consent', 'default', {
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  analytics_storage: 'denied',
  wait_for_update: 500,  // Wait for CMP to update consent
});

// After user accepts cookies via your CMP:
gtag('consent', 'update', {
  ad_storage: preferences.marketing ? 'granted' : 'denied',
  ad_user_data: preferences.marketing ? 'granted' : 'denied',
  analytics_storage: preferences.analytics ? 'granted' : 'denied',
});

Validate events before deploying:

# GA4 Measurement Protocol validation (returns hit validation report)
curl -X POST \
  "https://www.google-analytics.com/debug/mp/collect?measurement_id=G-XXXXXXXX&api_secret=YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"client_id":"test-123","events":[{"name":"purchase","params":{"transaction_id":"T-001","value":59.99,"currency":"USD"}}]}'

Best Practices

  • Clear ecommerce: null before every e-commerce push — GTM merges data layer objects, so stale item arrays from a previous event will contaminate the next one
  • Use your server-generated order ID as transaction_id — never generate it on the client; this ensures deduplication works when both browser and server events fire
  • Send Conversions API events from a post-payment webhook — webhook delivery is more reliable than the client completing a fetch call during checkout
  • Gate purchase events behind idempotency checks — store fired transaction_id values in sessionStorage and skip re-firing if the confirmation page is reloaded
  • Use GTM environments for staging — test GTM changes in a staging environment so QA traffic never pollutes live reports

Common Pitfalls

ProblemSolution
Duplicate purchase events in GA4Check sessionStorage.getItem('purchase_fired_' + order.id) before pushing; set it after the push fires
Items array empty in GTMForgot to push {ecommerce: null} before the event — GTM caches the previous items array
Meta Pixel and Conversions API both counting conversionsPass matching eventID (browser) and event_id (server) — Meta deduplicates on this field
Shopify GA4 funnel shows no dataVerify the GA4 Measurement ID in Online Store → Preferences matches your property; check GA4 DebugView to confirm events are firing
MonsterInsights not tracking WooCommerce ordersEnsure the Pro license is active (Enhanced eCommerce requires Pro); clear any caching plugins after installation

Related Skills

  • @webhook-architecture
  • @erp-integration
  • @email-service-integration
  • @gdpr-ecommerce

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.17%
按下载量换算69

Claude

29.71%
按下载量换算60

Cursor

17.74%
按下载量换算36

Gemini CLI

9.18%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills