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, audience exports, and more via REST or gRPC. Install with Composer (google/analytics-data) and authenticate using Google Cloud credentials. Part of Google Cloud PHP (beta).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy—eliminates reinventing Google Analytics Data API integration for PHP-based systems, reducing development time and maintenance overhead.
  • Feature Expansion: Enables real-time analytics reporting, audience segmentation, and custom metric tracking without relying on third-party SDKs or manual API calls.
  • Roadmap Alignment: Supports migration to Google Analytics 4 (GA4) via the v1beta API, ensuring future-proofing for analytics-dependent products (e.g., dashboards, A/B testing tools, or marketing platforms).
  • Use Cases:
    • Data-Driven Products: Embed dynamic analytics into SaaS platforms (e.g., e-commerce, SaaS metrics dashboards).
    • Automated Insights: Trigger actions (e.g., alerts, CRM updates) based on real-time GA4 data (e.g., "spikes in user engagement").
    • Audience Export: Sync GA4 audiences to CRM/CDP systems (e.g., HubSpot, Segment) via AudienceExport.
    • Custom Reporting: Build bespoke reports with granular filters (e.g., cohort analysis, sampling control) for internal tools or client-facing analytics.

When to Consider This Package

Adopt if:

  • Your PHP stack requires GA4 integration and you need server-side access to analytics data (not just UI dashboards).
  • You’re building a scalable analytics pipeline (e.g., ETL, real-time processing) and want to avoid manual API handling.
  • Your team lacks Google API expertise but needs reliable, maintained PHP bindings for GA4’s v1beta API.
  • You prioritize gRPC support for high-performance streaming (e.g., large dataset exports).

Look elsewhere if:

  • You’re using Universal Analytics (UA)—this package is GA4-only.
  • Your stack is non-PHP (e.g., Python, Node.js)—use Google’s official client libraries for those languages.
  • You need offline/bulk processing—consider Google’s BigQuery Export instead.
  • Your use case is simple UI dashboards—Google’s JavaScript SDK or Looker Studio may suffice.
  • You require legacy GA3 support—this package does not support it.

How to Pitch It (Stakeholders)

For Executives: "This PHP package lets us directly integrate Google Analytics 4 (GA4) into our backend systems—enabling real-time data processing, automated insights, and seamless CRM/CDP syncs without building custom API wrappers. It’s maintained by Google, reducing risk, and supports advanced features like audience exports and gRPC for high-performance needs. For example, we could auto-trigger marketing campaigns based on GA4 spikes or embed dynamic analytics into our SaaS dashboard—saving dev time and future-proofing our stack."

For Engineers: *"The google/analytics-data package provides idiomatic PHP access to GA4’s v1beta API, with support for:

  • Real-time reports (RunReport, RunPivotReport) with custom dimensions/metrics.
  • Audience management (export, list, query) for CRM/CDP integrations.
  • gRPC streaming for large datasets (e.g., batch exports).
  • Sampling control and quota monitoring to optimize costs. It’s battle-tested by Google, with active updates, and avoids reinventing OAuth/HTTP handling. The beta API is stable enough for production if we monitor deprecations. Tradeoff: No GA3 support, but we’re migrating anyway."*

For Data Teams: *"This gives us programmatic access to GA4’s raw data for:

  • Custom ETL pipelines (e.g., syncing to BigQuery/Snowflake).
  • Advanced segmentation (cohorts, comparisons) without UI limitations.
  • Automated alerts (e.g., ‘conversion rate drops >10%’). We’d need to design a data layer to abstract API calls, but it’s more reliable than scraping the UI."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4