Skip to main content

What you can sync

  • E-commerce events: Complete purchase funnel tracking with item details
  • Standard events: User engagement, navigation, and content interaction
  • Custom events: Any business-specific events you want to track
  • Audiences: Send audience membership as custom events

Prerequisites

  • A Google Analytics 4 property
  • A Measurement ID (format: G-XXXXXXXXXX)
  • A Measurement Protocol API Secret
You can find your Measurement ID in Google Analytics under Admin → Data Streams → [Your Stream] → Measurement ID. Create an API Secret under Admin → Data Streams → [Your Stream] → Measurement Protocol API secrets.

Event types

Google Analytics 4 supports three types of events that Masivo automatically handles:

E-commerce events (12 events)

These events track the complete purchase journey and preserve the items array structure:
EventWhen to sendKey parameters
add_payment_infoUser adds payment informationitems, currency, value, payment_type
add_shipping_infoUser adds shipping informationitems, currency, value, shipping_tier
add_to_cartUser adds item to cartitems, currency, value
add_to_wishlistUser adds item to wishlistitems, currency, value
begin_checkoutUser starts checkout processitems, currency, value, coupon
purchaseUser completes purchaseitems, transaction_id, currency, value, tax, shipping
refundPurchase is refundeditems, transaction_id, currency, value
remove_from_cartUser removes item from cartitems, currency, value
select_itemUser selects a productitems, item_list_id, item_list_name
view_cartUser views their cartitems, currency, value
view_itemUser views product detailsitems, currency, value
view_item_listUser views a list of productsitems, item_list_id, item_list_name

Standard events (20 events)

These events track user engagement and interaction:
EventWhen to sendKey parameters
app_openApp is opened-
clickUser clicks outbound linklink_url, link_text, link_domain
file_downloadUser downloads a filefile_name, file_extension, link_url
generate_leadUser submits a formcurrency, value
loginUser logs inmethod
page_viewPage loads (web)page_location, page_title, page_referrer
screen_viewScreen loads (app)screen_name, screen_class
scrollUser scrolls 90% of pagepercent_scrolled
searchUser performs a searchsearch_term
select_contentUser selects contentcontent_type, item_id
select_promotionUser clicks promotionpromotion_id, promotion_name, creative_name
shareUser shares contentmethod, content_type, item_id
sign_upUser creates accountmethod
tutorial_beginUser starts tutorial-
tutorial_completeUser completes tutorial-
video_completeUser completes videovideo_title, video_url, video_duration
video_progressVideo reaches milestonevideo_title, video_url, video_percent
video_startUser starts videovideo_title, video_url, video_provider
view_promotionUser sees promotionpromotion_id, promotion_name, creative_name
view_search_resultsUser views search resultssearch_term

Custom events

Any event not matching GA4 standard events will be sent as a custom event with flattened parameters.

Configuration

  1. Go to Settings → Integrations → Google Analytics 4 in the Masivo dashboard
  2. Enter your Measurement ID (format: G-XXXXXXXXXX)
  3. Enter your API Secret
  4. Enable the features you want to sync:
    • Events: All standard GA4 events
    • Purchases: Only fulfilled purchases
    • Audiences: Calculate and Delete operations
    • Customer tags: Sync customer tags as user properties
Make sure your Measurement ID starts with “G-” (for GA4). Universal Analytics properties (starting with “UA-”) are not supported.

How it works

Once configured, Masivo automatically transforms and sends your data to Google Analytics 4:
  1. Real-time sync: Events are sent as they occur in Masivo
  2. Smart transformation: Events are automatically transformed to match GA4’s expected format
  3. Event type detection: Masivo detects if an event is e-commerce, standard, or custom
  4. Data validation: Configuration and data are validated before sending
  5. Error handling: Failed syncs are logged for debugging

Automatic transformations

Masivo automatically handles several transformations to ensure compatibility:
  • Event names: Converted to lowercase (e.g., PURCHASEpurchase)
  • Field mapping: Common alternative field names are mapped automatically
  • Items preservation: E-commerce events preserve the full items array structure
  • Parameter flattening: Custom events flatten nested objects into flat key-value pairs
  • Timestamp conversion: Converts timestamps to GA4’s microsecond format

Data structure

Event format

Send events to Masivo using this structure:
{
  "type": "PURCHASE",
  "customer_id": "cust_123",
  "transaction_id": "ORD-789",
  "currency": "USD",
  "value": 159.99,
  "tax": 12.0,
  "shipping": 8.0,
  "order": {
    "purchase_id": "abc123",
    "value": 300,
    "discounted_value": 300,
    "products": [
      {
        "sku": "dawd",
        "amount": 1,
        "value": 12
      }
    ],
    "payment_method": "CREDIT"
  },
  "items": [
    {
      "item_id": "SKU-001",
      "item_name": "Running Shoes",
      "item_brand": "Nike",
      "item_category": "Footwear",
      "price": 129.99,
      "quantity": 1
    }
  ]
}

Items array structure

For e-commerce events, each item in the items array supports these native GA4 fields:
{
  "item_id": "SKU-001", // Required: Product ID
  "item_name": "Running Shoes", // Required: Product name
  "item_brand": "Nike", // Brand
  "item_category": "Footwear", // Primary category
  "item_category2": "Athletic", // Secondary category
  "item_category3": "Running", // Tertiary category
  "item_category4": "", // Fourth-level category
  "item_category5": "", // Fifth-level category
  "item_variant": "Blue/Size 10", // Variant (size, color, etc.)
  "price": 129.99, // Unit price
  "quantity": 1, // Quantity
  "currency": "USD", // Currency code
  "discount": 10.0, // Discount amount
  "coupon": "SAVE10", // Coupon code
  "affiliation": "Online Store", // Store/affiliate name
  "item_list_id": "search_results", // List identifier
  "item_list_name": "Search Results", // List name
  "location_id": "STORE-001", // Physical location ID
  "index": 0, // Position in list
  "promotion_id": "PROMO-123", // Promotion identifier
  "promotion_name": "Summer Sale", // Promotion name
  "creative_name": "Hero Banner", // Creative/banner name
  "creative_slot": "homepage_top" // Creative position
}
At minimum, each item must have either item_id or item_name. All other fields are optional but recommended for better reporting.

Field mapping

Masivo automatically maps common alternative field names to GA4 standards:
Your fieldMaps to GA4Context
iditem_idIn items
nameitem_nameIn items
branditem_brandIn items
unit_pricepriceIn items
order_idtransaction_idIn purchase/refund
querysearch_termIn search events

Examples

Add to cart event

{
  "type": "add_to_cart",
  "customer_id": "cust_123",
  "currency": "USD",
  "value": 49.99,
  "items": [
    {
      "item_id": "PROD-456",
      "item_name": "Wireless Headphones",
      "item_brand": "Sony",
      "item_category": "Electronics",
      "price": 49.99,
      "quantity": 1,
      "item_list_name": "Search Results"
    }
  ]
}

Search event

{
  "type": "search",
  "customer_id": "cust_123",
  "search_term": "wireless headphones"
}

Audience synchronization

Audience calculation operations

When audiences are calculated in Masivo, they’re sent to Google Analytics 4 as custom events:
  • Event name: audience_updated
  • Includes: audience_id, audience_name, customers_count, action
  • Customer IDs are included for reference

Audience DELETE operations

When audiences are deleted:
  • Event name: audience_removed
  • Automatically includes all customers in the audience
  • Ensures proper cleanup in your GA4 reports
Audience events use a special client_id of “audience_manager” and include all relevant customer information for proper tracking.

Validation

Before sending data to Google Analytics 4, Masivo validates:
  • API credentials: Measurement ID and API Secret are configured
  • Event configuration: The event type is enabled in your settings
  • Data completeness: Required fields are present for each event type
  • Purchase status: Only fulfilled purchases are sent (if configured)

Best practices

  1. Always include customer_id: This becomes the client_id in GA4
  2. Use consistent item IDs: Ensures accurate product analytics
  3. Include all item fields: Richer data enables better reporting
  4. Add currency codes: Required for accurate revenue tracking
  5. Send timestamps: Use issued_at for accurate event timing
  6. Include promotional data: Track campaign effectiveness with promotion_id, promotion_name, etc.
  7. Use item_list_name: Helps track where users interact with products

Limitations

  • Items array: Only preserved for e-commerce events; custom events flatten arrays
  • Nested objects: Custom events flatten nested objects into prefix_key format
  • Data types: Only primitives (string, number, boolean) are supported in custom events
  • Rate limits: Subject to Google Analytics 4 rate limits (typically not an issue)
Custom events (non-GA4 standard) will have their parameters flattened. For example, nested objects become event_object_field format.

Troubleshooting

Events not appearing in GA4

  • Check that your Measurement ID starts with “G-” (not “UA-”)
  • Verify your API Secret is correct
  • Ensure the event type is enabled in Masivo settings
  • Check that customer_id is included in your events

Purchase events missing

  • Verify that “Purchases” is enabled in settings
  • Confirm purchases are marked as fulfilled
  • Check that transaction_id is unique for each purchase
  • Ensure items array contains at least one item with item_id or item_name

Items not showing in reports

  • Verify each item has item_id or item_name
  • Check that currency and price are included
  • Ensure numeric fields (price, quantity) are sent as numbers, not strings
GA4 can take up to 24-48 hours to process and display new events in reports. Use the DebugView feature in GA4 to see events in real-time during testing.

Debug mode

To test your integration before going live:
  1. Enable debug mode in your GA4 property
  2. Send test events through Masivo
  3. View real-time events in GA4’s DebugView
  4. Verify event structure and parameters
Use GA4’s DebugView (Admin → DebugView) to see events in real-time and verify the data structure before sending production traffic.
I