Download the PHP package magebitcom/magento2-mcp-google-analytics-tools without Composer

On this page you can find all versions of the php package magebitcom/magento2-mcp-google-analytics-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento2-mcp-google-analytics-tools

Magento2 MCP - Google Analytics Tools

Google Analytics 4 tools for the Magebit MCP server. Exposes the Google Analytics Data API and Admin API as MCP tools so AI clients (Claude Desktop, ChatGPT, Gemini, Claude Code, MCP Inspector, …) can discover properties, run reports, and inspect schema metadata against your store's analytics property.

Mirrors the official google-analytics-mcp server, but configured through the Magento admin and authenticated with a connected Google account (OAuth) whose refresh token is stored encrypted in core_config_data.

Tools

All tools are read-only. Every tool accepts an optional property_id argument; when omitted, the Default GA4 Property ID from admin config is used.

Tool Description
google_analytics.account.summaries List every account + property visible to the connected Google account. Use this first to discover property IDs.
google_analytics.property.get Return the GA4 Property resource (display name, currency, time zone, industry, service level, …) for the given property.
google_analytics.property.google_ads_links List the Google Ads accounts linked to a GA4 property.
google_analytics.property.custom_dimensions_and_metrics List the custom dimensions and custom metrics defined on a property. Use before running a report to discover what custom fields are available.
google_analytics.report.run Run a GA4 Data API Core Report (runReport). Supports date_ranges, dimensions, metrics, filters, order-bys, aggregations, currency conversion.
google_analytics.report.run_realtime Run a GA4 Realtime Report (runRealtimeReport) — events in the last 30 minutes.
google_analytics.report.run_funnel Run a GA4 Funnel Report (runFunnelReport, Data API v1alpha).

Every tool surfaces errors as a soft error (isError: true in the MCP response) with a human-readable message, leaving the tools/call JSON-RPC response status as success. Common error cases:

Installation

The module depends on magebitcom/magento2-mcp-module and the official Google PHP SDKs (google/analytics-data, google/analytics-admin, google/auth). Composer resolves them automatically.

Connect a Google account

The tools act as a real Google user who already has access to your GA4 property.

  1. Enable the APIs in a Google Cloud project:
  2. Create an OAuth client. In APIs & Services → Credentials, choose Create credentials → OAuth client ID → Web application.
  3. Register the redirect URI. Copy the Authorized redirect URI shown in the Magento admin (Stores → Configuration → Magebit → Google Analytics MCP → Google Connection) into the OAuth client's Authorized redirect URIs. It looks like https://<your-admin-host>/<admin>/magebit_mcp_ga/oauth/callback. Google only accepts public HTTPS hosts (or localhost); if your store runs on a non-public host, set Redirect Base URL to a public tunnel host (ngrok / cloudflared) — the displayed redirect URI updates to match.
  4. Configure the consent screen — for internal use only. Set the User type to Internal so the OAuth client is restricted to your own Google Workspace organization.
  5. Paste client ID + secret into the admin config and click Save Config.
  6. Click Connect with Google and approve the consent screen with an account that has at least Viewer access to the GA4 property. The status flips to "Connected as [email protected]".
  7. (Optional) Set a Default GA4 Property ID — the numeric id (e.g. 123456789) used when a tool call doesn't specify one. Discover IDs at runtime via google_analytics.account.summaries.

The refresh token is stored encrypted at rest. Use Disconnect to revoke it from the store.

Granting tool access

Tool calls go through the standard Magebit MCP token + ACL flow:

  1. Edit (or create) the admin role that owns your MCP token under System → Permissions → User Roles.
  2. Under Role Resources, scroll to Stores → Settings → Configuration → Magebit → MCP → MCP Tools and tick the tool ACLs you want this token to use (each tool has its own resource, e.g. Tool: Run Google Analytics Report).
  3. Save. The next tool call from that token will see the tools in tools/list and be allowed to call them.

The admin Google Analytics MCP Configuration permission gates access to the connection settings — keep it scoped to people who should manage the Google connection.

Quick example

License

MIT — see LICENSE.


All versions of magento2-mcp-google-analytics-tools with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
magento/framework Version ^103.0
magebitcom/magento2-mcp-module Version ^1.0.0
google/analytics-data Version ^0.20
google/analytics-admin Version ^0.27
google/auth Version ^1.50
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package magebitcom/magento2-mcp-google-analytics-tools contains the following files

Loading the files please wait ...