0

I want to integrate google analytics with my Spring boot API. Whenever I send an event request, I always get forbidden in google analytics response. the request I'm using is

http://www.google-analytics.com/mp/collect?api_secret={API_SECRET}&measurement_id={MEASUREMENT_ID}

with a payload of:

{
  "client_id": "{CLIENT_ID}",
  "timestamp_micros": "1652351615578000",
  "non_personalized_ads": false,
  "events": [
      {
          "name": "test"
      }
  ]
}

I got the API_SECRET and MEASUREMENT_ID from analytics webpage and the CLIENT_ID in the payload from google analytics javascript library I don't know what I'm missing or doing wrong .

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented May 12, 2022 at 2:23

1 Answer 1

0

The correct endpoint for the google analytics measurement protocol ga4 is

https://www.google-analytics.com/mp/collect

You are using

HTTP.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.