Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Analytics Data Laravel Package

google/analytics-data

Idiomatic PHP client for the Google Analytics Data API (GA4). Query reports, dimensions/metrics, audience exports, and more via REST or gRPC. Install with Composer and authenticate with Google Cloud credentials to start making requests.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy—eliminates the need to build custom integrations for Google Analytics Data API (GA4), reducing development time and maintenance overhead. Leverages Google’s maintained, production-grade infrastructure.
  • Feature Expansion: Enables real-time analytics, cohort analysis, and audience segmentation directly in PHP applications (e.g., dashboards, reporting tools, or CRM integrations).
  • Roadmap Priorities:
    • Data-Driven Products: Accelerates development of features requiring granular analytics (e.g., A/B testing tools, user behavior heatmaps).
    • Compliance/Reporting: Simplifies GDPR/CCPA-compliant data exports and user consent tracking via audience exports (note: SheetExportAudienceList is now deprecated in v1alpha, limiting spreadsheet-based workflows).
    • Scalability: Supports high-volume reporting (e.g., enterprise SaaS platforms) with gRPC for low-latency streaming.
  • Use Cases:
    • Internal Tools: Power custom admin panels or analytics portals without third-party dependencies.
    • Automated Insights: Trigger actions (e.g., Slack alerts, database updates) based on real-time GA4 metrics.
    • Multi-Property Analytics: Manage cross-property reports (e.g., for marketing attribution) via unified API calls.

When to Consider This Package

  • Adopt When:

    • Your PHP stack requires direct GA4 integration (e.g., replacing legacy Universal Analytics or custom tracking).
    • You need programmatic access to GA4 data (e.g., for ETL pipelines, ML feature stores, or real-time dashboards).
    • Your team lacks bandwidth to maintain a custom API wrapper or prefers Google’s supported client.
    • You’re building audience-based features (e.g., dynamic user segmentation, export workflows) excluding spreadsheet exports (v1alpha’s SheetExportAudienceList is deprecated).
  • Look Elsewhere If:

    • You only need basic GA4 dashboards: Use Google’s UI or third-party tools (e.g., Looker Studio).
    • Your stack is non-PHP: Evaluate Google’s official client libraries for other languages.
    • You require offline/bulk processing or spreadsheet exports: Consider BigQuery exports, Google’s Data Transfer Service, or alternative tools like Supermetrics.
    • Cost sensitivity: GA4 API has quotas and pricing (e.g., $0.01 per 10K requests); audit usage if scaling to high volumes.
    • Legacy Universal Analytics: This package only supports GA4 (v1beta/v1alpha). Use google/analytics for UA (deprecated in 2023).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us own our analytics infrastructure—no more vendor lock-in to tools like Mixpanel or Amplitude. By integrating Google Analytics Data API directly into our PHP stack, we can:

  • Cut costs by replacing third-party dashboards with custom, lightweight solutions (note: spreadsheet exports are no longer supported in v1alpha, reducing legacy workflow dependencies).
  • Accelerate feature development (e.g., real-time user insights, automated cohort analysis) without waiting on engineering.
  • Future-proof our data strategy as Universal Analytics sunsets, using GA4’s advanced event tracking. Example: Our [Product] team could build a self-serve analytics portal in weeks, not months, while reducing cloud spend by 30%. Caveat: If your workflows rely on Google Sheets audience exports, this may require migration to alternative methods (e.g., direct API-to-database pipelines)."

For Engineering:

*"This is a drop-in replacement for manual API calls or bloated SDKs. Key wins:

  • Idiomatic PHP: Clean, type-safe client with async/gRPC support (faster than REST for high-volume queries).
  • Google’s Backing: Actively maintained (last release: March 2026), with clear deprecation paths.
  • Flexibility: Supports real-time reports, audience exports, and custom dimensions/metrics—no black-box limitations. Breaking Change:
    • v1alpha’s SheetExportAudienceList is removed (PR #9145). If your app relies on this, migrate to direct API exports or v1beta. Trade-offs:
    • Beta status: Minor breaking changes possible (e.g., v1alpha → v1beta migration in v0.22.0).
    • Quotas: Monitor usage to avoid cost surprises (sampled data reduces volume). Recommendation: Pilot with a non-critical feature (e.g., a dev-only analytics dashboard) before full adoption. Audit code for SheetExportAudienceList dependencies."

For Data Teams:

*"This gives us direct control over GA4 data—no more scraping or manual exports. Highlights:

  • Granular filtering: Query specific events, dimensions, or metrics (e.g., ga4:session_duration + device_category).
  • Audience exports: Automate user segmentation for marketing tools (e.g., export high-LTV users to a CRM) via API, not spreadsheets (note: v1alpha’s sheet exports are deprecated).
  • Sampling control: Adjust sampling_level to balance cost/accuracy for large datasets. Example: We could automate weekly cohort reports in PHP, eliminating manual CSV exports. Action Item: Review existing workflows for SheetExportAudienceList usage and plan migration to direct API exports or alternative tools."
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle