Skip to main content
Developers can now send data from MoEngage to Google Analytics tool using our Connectors via GA Measurement Protocol. Google Analytics Measurement Protocol allows developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers. This in turn enables developers to measure how users interact with their business from almost any environment. Developers can then use the Measurement Protocol to:
  • Measure user activity in new environments.
  • Tie online to offline behavior.
  • Send data from both the client and server.

Measurement Protocol (Google Analytics 4)

Google Analytics 4 only supports POST calls. To send an event, make a HTTP POST request to the following endpoint:
POST /mp/collect HTTP/1.1
HOST: www.google-analytics.com
Content-Type: application/json
<payload_data>
Data is sent to Google Analytics using the Measurement Protocol Data in two parts:
  1. Query parameters
  2. A JSON POST body

Query Parameters

Parameter NameDescription
api_secretRequired.
An API Secret that is generated through the Google Analytics UI. An API Secret that is generated through the Google Analytics UI.
To create a new secret, navigate in the Google Analytics UI to:
Admin > Data Streams > choose your stream > Measurement Protocol > Create
measurement_idOptional.
Measurement ID. The identifier for a Data Stream. Found in the Google Analytics UI under: Admin > Data Streams > choose your stream > Measurement ID
firebase_app_idRequired only if using a Firebase app.
Firebase App ID. The identifier for a Firebase app. Found in the Firebase console under: Project Settings > General > Your Apps > App ID
Read more about the required query parameters of the Measurement Protocol.

JSON POST body

The payload of your request depends on the events and attributes that you want to track. Below are the required fields:
Parameter NameDescription
client_idRequired only if using gtag.js.
Uniquely identifies a user instance of a web client. See send event to the Measurement Protocol.
app_instance_idRequired only if using a Firebase app.
Uniquely identifies a specific installation of a Firebase app. This value needs to be retrieved through the Firebase SDK.
eventsRequired.
An array of event items.
Read more about the required JSON post-body parameters of the Measurement Protocol.

Setting up a connector campaign

To create a connector campaign on MoEngage,
  1. On the sidebar menu in MoEngage, hover over the Engage icon Screenshot 2025-06-04 at 4.32.53 PM.png . The Engage menu appears.
  2. Click + New Campaign. 1.png You can also click All Campaigns on the Engage menu and then click + Create campaign on the All campaigns page.
  3. On the New Campaign dialog box, under Connectors, click Event Triggered. custom.png
  4. Give your campaign a name and relevant tags.
  5. Configure your trigger criteria. You can optionally choose to add a delay as well.
  6. Choose your target audience. You can also check the count of your audience.
  7. Click next to proceed to the next step.
  8. On step 2 of the campaign,
    • Select the method as POST.
    • Add Webhook URL as : https://www.google-analytics.com//mp/collect?api_secret=<api_secret>&measurement_id=<measurement_id>
    • The URL parameters list should auto-populate. Replace <api_secret> with your API Secret Key. You can swap this parameter with firebase_app_id if you’re using a Firebase app. Replace <measurement_id> with the ID of your Data Stream.
    • In Headers, add Content-Type as application/json.
    • In Body, choose Raw and use the content depending on what events you want to send to Google Analytics. Below is an example:\
      {
          "client_id": "<client_id>",
          "user_id": "{{UserAttribute['ID']}}",
          "timestamp_micros": "{{EventAttribute['Event Time (UTC)']}}",
          "user_properties": {
              "email": {
                  "value": "{{UserAttribute['Email (Standard)']}}"
              }
          },
          "events": [
              {
                  "name": "cart_checkout",
                  "params": {
                      "checkout_value": 1000
                  }
              }
          ]
      }
      
      • Make sure to replace <client_id> with the client ID (if using gtag.js). You can also swap this key with app_instance_id if you’re using a Firebase app.
  1. At this point, your campaign should be ready to test and send. You can also test your connector configuration using the Test functionality available in Step 2 of Create Connector Campaign.
Screen_Shot_2022-02-22_at_11.12.42_AM.png If your Google Analytics account successfully receives the event, your set-up is good to go. You can go ahead and Publish the campaign.