Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Discussion: Use google measurement protocol for ecommerce events (enhanced compatibility with HTTP Events API)

Open
#17 2 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

Currently, the google managed component doesn't use the measurement protocol for tracking ecommerce events. However, it seems particularly useful for exactly that in server-side environments.

Current state

Right now, when using the HTTP Events API, the MC will return a few client fetch requests which you then have to manually execute on the client side, if you don't do that, the checkouts, etc won't be tracked.

Proposed solution

While you can definitely return the response object of the tracking call and forward it to the client, this seems a little sub-optimal as there is an actual API from Google that you can use for exactly this scenario (and only this scenario, the measurement protocol doesn't allow you to send pageviews for example). Instead of client.fetch, manager.fetch could be called with the ecommerce request payload. This would also be more resilient against ad blockers.

I know that a lot of other questions would have to be answered to assess if this is feasible. This issue is to identify what these are and to start a discussion about using the measurement protocol in general.

Dominant language
TypeScript
Stars
27
Forks
9
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from managed-components/google-analytics-4

All issues in managed-components/google-analytics-4

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.