Knowledge Base
HomeMain site
HomeMain site
General SetupWebsite SnippetsAPI Endpoints
General SetupWebsite SnippetsAPI Endpoints
  1. GA4 Measurement Protocol
  • DRE Measurement Protocol
    • Order (create)
      POST
    • Order (cancel)
      POST
    • Lead (create)
      POST
    • Batch (create)
      POST
  • GA4 Measurement Protocol
    • Batch (create)
      POST
  • 4WP Measurement Protocol
    • Elementor Forms Lead (create)
      POST
  1. GA4 Measurement Protocol

Batch (create)

TEST environment
https://{{BASE_DOMAIN}}/a2/test
TEST environment
https://{{BASE_DOMAIN}}/a2/test
POST
https://{{BASE_DOMAIN}}/a2/test
/mp4/collect
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://dre2.yourdomain.com/a2/test/mp4/collect?measurement_id&api_secret=&id=' \
--header 'X-Dre-Access-Token;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_id": "string",
    "user_id": "string",
    "events": [
        {
            "name": "purchase",
            "params": {
                "currency": "string",
                "value": 0.59,
                "coupon": "string",
                "tax": 0,
                "transaction_id": "string",
                "items": [
                    {
                        "item_id": "string",
                        "item_group_id": "123456",
                        "item_sku": "123456",
                        "item_group_sku": "string",
                        "item_name": "string",
                        "item_variant": "string",
                        "item_brand": "No Brand",
                        "item_category": "Shoes",
                        "item_category2": "string",
                        "item_category3": "string",
                        "item_category4": "string",
                        "item_category5": "string",
                        "currency": "RON",
                        "price": 12.34,
                        "discount": 0,
                        "coupon": "string",
                        "item_tax_percent": 0,
                        "quantity": 1,
                        "item_stock_status": "true",
                        "index": 1
                    }
                ],
                "event_source": "website",
                "event_location_name": "string",
                "shipping": 0,
                "shipping_tier": "string",
                "shipping_warehouse_name": "string",
                "payment_type": "string",
                "ip_override": "string",
                "session_id": "string",
                "user_agent": "string"
            }
        }
    ],
    "user_data": {
        "email": "test@example.com",
        "sha256_email_address": "a8af8341993604f29cd4e0e5a5a4b5d48c575436c38b28abbfd7d481f345d5db",
        "phone_number": "+40744123123",
        "sha256_phone_number": "973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b",
        "address": {
            "first_name": "John",
            "sha256_first_name": "d63d71f407ad92113aa5b858936038d68e0fde0a7ed8b8a03a4fea2c2eab80d5",
            "last_name": "Doe",
            "sha256_last_name": "d63d71f407ad92113aa5b858936038d68e0fde0a7ed8b8a03a4fea2c2eab80d5",
            "country": "RO",
            "region": "string",
            "city": "Bucuresti",
            "street": "string",
            "postal_code": "700000"
        }
    },
    "user_properties": {
        "custom_user_property_name": {
            "value": "string"
        },
        "second_user_property_name": {
            "value": "string"
        }
    },
    "consent": {
        "ad_user_data": "GRANTED",
        "ad_personalization": "GRANTED"
    }
}'
Response Response Example
{}

Request

Query Params
measurement_id
string 
optional
api_secret
string 
required
Your secret access token. Will be provided by DATA Reshape Team
Default:
{{X_DRE_ACCESS_TOKEN}}
id
string 
required
Your script ID. Will be provided by DATA Reshape Team
Default:
{{SCRIPT_ID}}
Match pattern:
^[A-Z0-9]{8}$
Header Params
Content-Type
string 
required
Default:
application/json
X-Dre-Access-Token
string 
required
Your secret access token. Will be provided by DATA Reshape Team
Default:
{{X_DRE_ACCESS_TOKEN}}
Body Params application/json
client_id
string 
required
Uniquely identifies a user instance of a web client. Unique browser ID. Typicaly is the last 2 parts of _ga cookie value, separated by dot sign.
user_id
string 
optional
A unique identifier for a user. Can only contain utf-8 characters.
events
array [anyOf] 
required
>= 1 items<= 20 items
object (event data purchase) 
optional
object (event data refund ) 
optional
object (event data lead) 
optional
user_data
object (user data) 
required
email
string <email> | null 
required
Examples:
test@example.comtest@test.co.uktest@sub.test.com
Match pattern:
^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}(?:\.[a-z]{2,})?$
sha256_email_address
string  | null 
required
Hashed customer email address (SHA256 HEX without HMAC)
Example:
a8af8341993604f29cd4e0e5a5a4b5d48c575436c38b28abbfd7d481f345d5db
Match pattern:
^[a-z0-9]{64}$
phone_number
string  | null 
required
User phone number. Must be in E.164 format, which means it must be 11 to 15 digits including a plus sign (+) prefix and country code with no dashes, parentheses, or spaces.
Examples:
+40744123123+493012345678
Match pattern:
^[0-9+]{11,15}$
sha256_phone_number
string  | null 
required
Example:
973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b
Match pattern:
^[a-z0-9]{64}$
address
object (address) 
optional
user_properties
object 
optional
custom_user_property_name
object 
required
second_user_property_name
object 
required
consent
object (consent) 
optional
ad_user_data
enum<string> 
required
Allowed values:
GRANTEDDENIED
ad_personalization
enum<string> 
required
Allowed values:
GRANTEDDENIED
Examples

Responses

🟢200Success
application/json
Body
object {0}
Modified at 2024-04-11 20:00:56
Previous
Batch (create)
Next
Elementor Forms Lead (create)
Built with