pixellint

GA4 Measurement Protocol checks location metadata.

Measurement Protocol requests to the Google Analytics 4 collection endpoint, including the regional and debug variants and the JSON event payload.

Structured locations receive country and region recommendations. An IP override ignored by a supplied structured location is excluded from location validation.

What this pack matches

Hosts
google-analytics.com
Paths
/mp/collect, /debug/mp/collect
Vendor docs
developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events

Rules

Codes are stable. A finding in CI, MCP, or the playground lands on the same id.

Field Required What it checks Rule ids Source
api_secret required It authenticates the request and is created in the GA4 admin UI. Fix: Create a Measurement Protocol API secret for the stream and send it as `api_secret`. vendor.google-analytics.param.api_secret.missing
vendor.google-analytics.param.api_secret.empty
docs
measurement_id optional Web stream measurement IDs start with `G-`. Fix: Use the web stream measurement ID, or send `firebase_app_id` for an app stream. vendor.google-analytics.param.measurement_id.empty
vendor.google-analytics.param.measurement_id.invalid
docs
firebase_app_id optional It identifies an app stream and replaces `measurement_id`. vendor.google-analytics.param.firebase_app_id.empty docs
stream.identifier_missing required The request identifies no GA4 stream. Web streams send `measurement_id` and app streams send `firebase_app_id`. Fix: Add `measurement_id` for a web stream or `firebase_app_id` for an app stream. vendor.google-analytics.stream.identifier_missing docs
stream.identifier_ambiguous required The request sends both `measurement_id` and `firebase_app_id`. One request targets one stream type. Fix: Keep the identifier that matches the stream this event belongs to and drop the other. vendor.google-analytics.stream.identifier_ambiguous docs
https_required required Google requires HTTPS for Measurement Protocol requests. vendor.google-analytics.https_required docs
client_id optional It identifies the browser or device the event belongs to, and events without it are not joined to a user. Native JSON type: string. Fix: Send the `_ga` cookie's client id, or a stable id of your own. vendor.google-analytics.body.client_id.empty
vendor.google-analytics.body.client_id.invalid
docs
events optional Google documents the events array as the one required field of the request body. An empty array sends no events at all. Native JSON type: array. Minimum array items: 1. Maximum array items: 25. Fix: Send an `events` array holding at least one event. vendor.google-analytics.body.events.invalid docs
timestamp_micros optional Google documents this as a Unix timestamp in microseconds, not milliseconds. A 13-digit value is milliseconds and a 10-digit value is seconds. Native JSON type: integer. Minimum numeric value: 0. Fix: Multiply a millisecond timestamp by 1000, or a second timestamp by 1000000. vendor.google-analytics.body.timestamp_micros.empty
vendor.google-analytics.body.timestamp_micros.invalid
docs
non_personalized_ads deprecated Google marks it deprecated in the Measurement Protocol reference. Native JSON type: boolean. Fix: Use the `consent` object instead. vendor.google-analytics.body.non_personalized_ads.deprecated
vendor.google-analytics.body.non_personalized_ads.invalid
docs
user_id optional It is a stable user identifier. Google documents `user_id` on the Measurement Protocol envelope. Native JSON type: string. Fix: Send a stable `user_id` when you have one, or omit the field. vendor.google-analytics.body.user_id.empty
vendor.google-analytics.body.user_id.invalid
docs
consent.ad_user_data optional It is consent for sending user data to Google for advertising. Google documents `GRANTED` or `DENIED`. Native JSON type: string. Fix: Set `consent.ad_user_data` to `GRANTED` or `DENIED`. vendor.google-analytics.body.consent.ad_user_data.empty
vendor.google-analytics.body.consent.ad_user_data.invalid
docs
consent.ad_personalization optional It is consent for personalized advertising. Google documents `GRANTED` or `DENIED`. Native JSON type: string. Fix: Set `consent.ad_personalization` to `GRANTED` or `DENIED`. vendor.google-analytics.body.consent.ad_personalization.empty
vendor.google-analytics.body.consent.ad_personalization.invalid
docs
validation_behavior optional It selects how strictly the Measurement Protocol validates the payload. Google documents `RELAXED` or `ENFORCE_RECOMMENDATIONS`. Native JSON type: string. Fix: Send `RELAXED` or `ENFORCE_RECOMMENDATIONS`, or omit the field. vendor.google-analytics.body.validation_behavior.empty
vendor.google-analytics.body.validation_behavior.invalid
docs
ip_override optional Google ignores ip_override when a structured user_location object is supplied. Validate the IP only when that higher-priority object is absent or not established. Applies when {"kind":"not","condition":{"kind":"json_type","param":"user_location","json_type":"object"}}. Native JSON type: string. Fix: Send the visitor IP as `ip_override`, or send `user_location` instead. vendor.google-analytics.body.ip_override.empty
vendor.google-analytics.body.ip_override.invalid
docs
user_location.country_id recommended Google recommends country_id and region_id at a minimum when user_location is supplied. Missing values are advice; existing native-type and supplied-value checks remain active. Applies when {"kind":"json_type","param":"user_location","json_type":"object"}. Presence diagnostic severity: warning. Value diagnostic severity: error. Native JSON type: string. Fix: Send a two-letter country code such as `US`. vendor.google-analytics.body.user_location.country_id.missing
vendor.google-analytics.body.user_location.country_id.empty
vendor.google-analytics.body.user_location.country_id.invalid
docs
user_properties.user_id forbidden Google reserves `user_id` as a user property name. Send `user_id` on the envelope instead. Fix: Move the identifier to the top-level `user_id` field. vendor.google-analytics.body.user_properties.user_id.forbidden docs
app_instance_id optional The vendor documents `app_instance_id` in the request contract. Native JSON type: string. vendor.google-analytics.body.app_instance_id.invalid docs
events[] optional The vendor documents `events[]` in the request contract. Native JSON type: object. vendor.google-analytics.body.events[].invalid docs
user_properties optional The vendor documents `user_properties` in the request contract. Native JSON type: object. Maximum object properties: 25. vendor.google-analytics.body.user_properties.invalid docs
user_data optional The vendor documents `user_data` in the request contract. Native JSON type: object. vendor.google-analytics.body.user_data.invalid docs
consent optional The vendor documents `consent` in the request contract. Native JSON type: object. vendor.google-analytics.body.consent.invalid docs
user_location optional The vendor documents `user_location` in the request contract. Native JSON type: object. vendor.google-analytics.body.user_location.invalid docs
device optional The vendor documents `device` in the request contract. Native JSON type: object. vendor.google-analytics.body.device.invalid docs
user_location.city optional The vendor documents `user_location.city` in the request contract. Native JSON type: string. vendor.google-analytics.body.user_location.city.invalid docs
user_location.region_id recommended Google recommends country_id and region_id at a minimum when user_location is supplied. Missing values are advice; existing native-type and supplied-value checks remain active. Applies when {"kind":"json_type","param":"user_location","json_type":"object"}. Presence diagnostic severity: warning. Value diagnostic severity: error. Native JSON type: string. vendor.google-analytics.body.user_location.region_id.missing
vendor.google-analytics.body.user_location.region_id.empty
vendor.google-analytics.body.user_location.region_id.invalid
docs
user_location.subcontinent_id optional The vendor documents `user_location.subcontinent_id` in the request contract. Native JSON type: string. vendor.google-analytics.body.user_location.subcontinent_id.empty
vendor.google-analytics.body.user_location.subcontinent_id.invalid
docs
user_location.continent_id optional The vendor documents `user_location.continent_id` in the request contract. Native JSON type: string. vendor.google-analytics.body.user_location.continent_id.empty
vendor.google-analytics.body.user_location.continent_id.invalid
docs
device.category optional The vendor documents `device.category` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.category.invalid docs
device.language optional Google documents the device language as an ISO 639-1 tag. The published examples are en and en-US. Other shapes warn. Value diagnostic severity: warning. Native JSON type: string. Fix: Send a tag such as en or en-US. vendor.google-analytics.body.device.language.empty
vendor.google-analytics.body.device.language.invalid
docs
device.screen_resolution optional The vendor documents `device.screen_resolution` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.screen_resolution.empty
vendor.google-analytics.body.device.screen_resolution.invalid
docs
device.operating_system optional The vendor documents `device.operating_system` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.operating_system.invalid docs
device.operating_system_version optional The vendor documents `device.operating_system_version` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.operating_system_version.invalid docs
device.model optional The vendor documents `device.model` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.model.invalid docs
device.brand optional The vendor documents `device.brand` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.brand.invalid docs
device.browser optional The vendor documents `device.browser` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.browser.invalid docs
device.browser_version optional The vendor documents `device.browser_version` in the request contract. Native JSON type: string. vendor.google-analytics.body.device.browser_version.invalid docs
user_properties.first_open_time forbidden The vendor documents `user_properties.first_open_time` in the request contract. vendor.google-analytics.body.user_properties.first_open_time.forbidden docs
user_properties.first_visit_time forbidden The vendor documents `user_properties.first_visit_time` in the request contract. vendor.google-analytics.body.user_properties.first_visit_time.forbidden docs
user_properties.last_deep_link_referrer forbidden The vendor documents `user_properties.last_deep_link_referrer` in the request contract. vendor.google-analytics.body.user_properties.last_deep_link_referrer.forbidden docs
user_properties.first_open_after_install forbidden The vendor documents `user_properties.first_open_after_install` in the request contract. vendor.google-analytics.body.user_properties.first_open_after_install.forbidden docs
reserved_names… forbidden The vendor documents `reserved_names` in the request contract. vendor.google-analytics.body.reserved_names.forbidden docs
root optional The vendor documents `` in the request contract. Native JSON type: object. vendor.google-analytics.body.root.invalid docs
overlong_names… forbidden The vendor documents `overlong_names` in the request contract. vendor.google-analytics.body.overlong_names.forbidden docs
events[].name optional The vendor documents `events[].name` in the request contract. docs
user_data.sha256_email_address optional The vendor documents `user_data.sha256_email_address` in the request contract. Native JSON type: string or array. Maximum array items: 3. vendor.google-analytics.body.user_data.sha256_email_address.invalid docs
user_data.sha256_phone_number optional The vendor documents `user_data.sha256_phone_number` in the request contract. Native JSON type: string or array. Maximum array items: 3. vendor.google-analytics.body.user_data.sha256_phone_number.invalid docs
user_data.address optional The vendor documents `user_data.address` in the request contract. Native JSON type: object or array. Maximum array items: 2. vendor.google-analytics.body.user_data.address.invalid docs
body.hashed_plaintext_field required `ip_override` looks like a SHA-256 digest, but Google documents it as an IP address. Fix: Send the raw IP address. vendor.google-analytics.body.hashed_plaintext_field docs
body.client_or_app_instance_required required The request does not satisfy the documented client or app instance required requirement. vendor.google-analytics.body.client_or_app_instance_required docs
body.app_events_require_app_identifier required The request does not satisfy the documented app events require app identifier requirement. vendor.google-analytics.body.app_events_require_app_identifier docs
body.app_events_exclude_client_identifier required The request does not satisfy the documented app events exclude client identifier requirement. vendor.google-analytics.body.app_events_exclude_client_identifier docs
body.events_or_user_data_required required The request does not satisfy the documented events or user data required requirement. vendor.google-analytics.body.events_or_user_data_required docs
body.user_data_user_id_recommended recommended Google recommends user_id when user_data is provided. vendor.google-analytics.body.user_data_user_id_recommended docs
body.request_size required The Measurement Protocol request body must be smaller than 130kB. vendor.google-analytics.body.request_size docs
body.user_location.continent_id.registry recommended The geographic code is outside the current UNM49 or ISO-alpha2 reference table. Version-specific Google interpretation may differ. vendor.google-analytics.body.user_location.continent_id.registry docs
body.user_location.subcontinent_id.registry recommended The geographic code is outside the current UNM49 or ISO-alpha2 reference table. Version-specific Google interpretation may differ. vendor.google-analytics.body.user_location.subcontinent_id.registry docs
name required Google documents event names as 40 characters or fewer. Body scope: events[]. Value diagnostic severity: warning. Native JSON type: string. Maximum decoded characters: 40. Fix: Use a short name of letters, digits, and underscores, starting with a letter. vendor.google-analytics.body.name.missing
vendor.google-analytics.body.name.empty
vendor.google-analytics.body.name.invalid
docs
params.currency optional It is the ISO 4217 currency code, and Google requires it whenever `value` is set. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. Fix: Use the three-letter code, such as `USD`. vendor.google-analytics.body.params.currency.empty
vendor.google-analytics.body.params.currency.invalid
docs
params.value optional It is the monetary value of the event. Body scope: events[]. Native JSON type: number. Fix: Set it to the sum of price times quantity across the items, excluding shipping and tax. vendor.google-analytics.body.params.value.invalid docs
params.transaction_id optional It identifies the transaction, and Google requires it for purchase and refund events. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.transaction_id.invalid docs
params.items optional It lists the items the event covers. Body scope: events[]. Native JSON type: array. Minimum array items: 1. Maximum array items: 200. vendor.google-analytics.body.params.items.invalid docs
params.session_id recommended It identifies the user session. Google documents `session_id` as a positive number, and events without it do not contribute correctly to session reports. Body scope: events[]. Native JSON type: integer. Minimum numeric value: 1. Fix: Send `session_id` as digits, matching the Analytics session for this user. vendor.google-analytics.body.params.session_id.missing
vendor.google-analytics.body.params.session_id.empty
vendor.google-analytics.body.params.session_id.invalid
docs
params.engagement_time_msec recommended It is engagement duration in milliseconds since the preceding event. Google documents it so Realtime and average engagement time stay accurate. Body scope: events[]. Native JSON type: integer. Minimum numeric value: 0. Fix: Send `engagement_time_msec` as milliseconds of engagement since the last event. vendor.google-analytics.body.params.engagement_time_msec.missing
vendor.google-analytics.body.params.engagement_time_msec.empty
vendor.google-analytics.body.params.engagement_time_msec.invalid
docs
params optional The vendor documents `params` in the request contract. Body scope: events[]. Native JSON type: object. Maximum object properties: 25. vendor.google-analytics.body.params.invalid docs
params.items[] optional The vendor documents `params.items[]` in the request contract. Body scope: events[]. Native JSON type: object. vendor.google-analytics.body.params.items[].invalid docs
params.search_term optional The vendor documents `params.search_term` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.search_term.invalid docs
params.virtual_currency_name optional The vendor documents `params.virtual_currency_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.virtual_currency_name.invalid docs
params.level optional The vendor documents `params.level` in the request contract. Body scope: events[]. Native JSON type: number. vendor.google-analytics.body.params.level.invalid docs
params.coupon optional The vendor documents `params.coupon` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.coupon.invalid docs
params.payment_type optional The vendor documents `params.payment_type` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.payment_type.invalid docs
params.shipping_tier optional The vendor documents `params.shipping_tier` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.shipping_tier.invalid docs
params.item_list_id optional The vendor documents `params.item_list_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.item_list_id.invalid docs
params.item_list_name optional The vendor documents `params.item_list_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.item_list_name.invalid docs
params.promotion_id optional The vendor documents `params.promotion_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.promotion_id.invalid docs
params.promotion_name optional The vendor documents `params.promotion_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.promotion_name.invalid docs
params.creative_name optional The vendor documents `params.creative_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.creative_name.invalid docs
params.creative_slot optional The vendor documents `params.creative_slot` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.creative_slot.invalid docs
params.method optional The vendor documents `params.method` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.method.invalid docs
params.content_type optional The vendor documents `params.content_type` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.content_type.invalid docs
params.content_id optional The vendor documents `params.content_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.content_id.invalid docs
params.item_name optional The vendor documents `params.item_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.item_name.invalid docs
params.group_id optional The vendor documents `params.group_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.group_id.invalid docs
params.character optional The vendor documents `params.character` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.character.invalid docs
params.campaign_id optional The vendor documents `params.campaign_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.campaign_id.invalid docs
params.campaign optional The vendor documents `params.campaign` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.campaign.invalid docs
params.source optional The vendor documents `params.source` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.source.invalid docs
params.medium optional The vendor documents `params.medium` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.medium.invalid docs
params.term optional The vendor documents `params.term` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.term.invalid docs
params.content optional The vendor documents `params.content` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.content.invalid docs
params.ad_platform optional The vendor documents `params.ad_platform` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.ad_platform.invalid docs
params.ad_source optional The vendor documents `params.ad_source` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.ad_source.invalid docs
params.ad_format optional The vendor documents `params.ad_format` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.ad_format.invalid docs
params.ad_unit_name optional The vendor documents `params.ad_unit_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.ad_unit_name.invalid docs
params.screen_class optional The vendor documents `params.screen_class` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.screen_class.invalid docs
params.screen_name optional The vendor documents `params.screen_name` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.screen_name.invalid docs
params.shipping optional The vendor documents `params.shipping` in the request contract. Body scope: events[]. Native JSON type: number. vendor.google-analytics.body.params.shipping.invalid docs
params.tax optional The vendor documents `params.tax` in the request contract. Body scope: events[]. Native JSON type: number. vendor.google-analytics.body.params.tax.invalid docs
params.score optional The vendor documents `params.score` in the request contract. Body scope: events[]. Native JSON type: number. vendor.google-analytics.body.params.score.invalid docs
params.achievement_id optional The vendor documents `params.achievement_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.achievement_id.invalid docs
params.lead_source optional The vendor documents `params.lead_source` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.lead_source.invalid docs
params.disqualified_lead_reason optional The vendor documents `params.disqualified_lead_reason` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.disqualified_lead_reason.invalid docs
params.unconvert_lead_reason optional The vendor documents `params.unconvert_lead_reason` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.unconvert_lead_reason.invalid docs
reserved_names… forbidden The vendor documents `reserved_names` in the request contract. Body scope: events[]. vendor.google-analytics.body.reserved_names.forbidden docs
overlong_names… forbidden The vendor documents `overlong_names` in the request contract. Body scope: events[]. vendor.google-analytics.body.overlong_names.forbidden docs
params.firebase_conversion forbidden The vendor documents `params.firebase_conversion` in the request contract. Body scope: events[]. vendor.google-analytics.body.params.firebase_conversion.forbidden docs
params.item_id optional The vendor documents `params.item_id` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.item_id.invalid docs
params.lead_status optional The vendor documents `params.lead_status` in the request contract. Body scope: events[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.params.lead_status.invalid docs
params.unique_search_term optional The vendor documents `params.unique_search_term` in the request contract. Body scope: events[]. Native JSON type: integer. vendor.google-analytics.body.params.unique_search_term.empty
vendor.google-analytics.body.params.unique_search_term.invalid
docs
timestamp_micros optional An event-level microsecond timestamp overrides the request timestamp. Body scope: events[]. Native JSON type: integer. Minimum numeric value: 0. vendor.google-analytics.body.timestamp_micros.invalid docs
invalid_parameter_names… forbidden Parameter names must start with an alphabetic character and contain only alphanumeric characters or underscores. Body scope: events[]. vendor.google-analytics.body.invalid_parameter_names.forbidden docs
parameter_values… optional String parameter values are at most 500 characters on Analytics 360 and at most 100 on standard properties. This pack enforces the shared upper bound. Body scope: events[]. Native JSON type: string or number or boolean or array or object or null. Maximum decoded characters: 500. vendor.google-analytics.body.parameter_values.invalid docs
request_timestamp optional Body scope: events[]. docs
request_validation optional Body scope: events[]. docs
body.purchase_requires_ecommerce_fields required This event is missing documented required ecommerce fields. Body scope: events[]. Fix: Add the required ecommerce parameters to the event. vendor.google-analytics.body.purchase_requires_ecommerce_fields docs
body.refund_requires_ecommerce_fields required This event is missing documented required ecommerce fields. Body scope: events[]. Fix: Add the required ecommerce parameters to the event. vendor.google-analytics.body.refund_requires_ecommerce_fields docs
body.cart_requires_ecommerce_fields required This event is missing documented required ecommerce fields. Body scope: events[]. Fix: Add `currency`, `value`, and the `items` array to the event. vendor.google-analytics.body.cart_requires_ecommerce_fields docs
body.view_item_requires_ecommerce_fields required This event is missing documented required ecommerce fields. Body scope: events[]. Fix: Add `currency`, `value`, and the `items` array to the event. vendor.google-analytics.body.view_item_requires_ecommerce_fields docs
body.search_required_fields required The request does not satisfy the documented search required fields requirement. Body scope: events[]. vendor.google-analytics.body.search_required_fields docs
body.spend_virtual_currency_required_fields required The request does not satisfy the documented spend virtual currency required fields requirement. Body scope: events[]. vendor.google-analytics.body.spend_virtual_currency_required_fields docs
body.add_shipping_info_requires_items required The request does not satisfy the documented add shipping info requires items requirement. Body scope: events[]. vendor.google-analytics.body.add_shipping_info_requires_items docs
body.remove_from_cart_requires_items required The request does not satisfy the documented remove from cart requires items requirement. Body scope: events[]. vendor.google-analytics.body.remove_from_cart_requires_items docs
body.select_item_requires_items required The request does not satisfy the documented select item requires items requirement. Body scope: events[]. vendor.google-analytics.body.select_item_requires_items docs
body.view_item_list_requires_items required The request does not satisfy the documented view item list requires items requirement. Body scope: events[]. vendor.google-analytics.body.view_item_list_requires_items docs
body.select_promotion_requires_items recommended Promotion events without items are omitted from some promotion reports. Body scope: events[]. vendor.google-analytics.body.select_promotion_requires_items docs
body.view_promotion_requires_items required view_promotion requires an items array. Body scope: events[]. vendor.google-analytics.body.view_promotion_requires_items docs
body.post_score_required_fields required The request does not satisfy the documented post score required fields requirement. Body scope: events[]. vendor.google-analytics.body.post_score_required_fields docs
body.unlock_achievement_required_fields required The request does not satisfy the documented unlock achievement required fields requirement. Body scope: events[]. vendor.google-analytics.body.unlock_achievement_required_fields docs
body.value_requires_currency required The request does not satisfy the documented value requires currency requirement. Body scope: events[]. vendor.google-analytics.body.value_requires_currency docs
body.reserved_event_name required The request does not satisfy the documented reserved event name requirement. Body scope: events[]. vendor.google-analytics.body.reserved_event_name docs
body.selected_content_identifier required The request does not satisfy the documented selected content identifier requirement. Body scope: events[]. vendor.google-analytics.body.selected_content_identifier docs
body.close_convert_lead_currency_requires_value required The request does not satisfy the documented close convert lead currency requires value requirement. Body scope: events[]. vendor.google-analytics.body.close_convert_lead_currency_requires_value docs
body.event_timestamp_age required With ENFORCE_RECOMMENDATIONS, the effective event or user-property timestamp cannot be earlier than 72 hours ago. A local timestamp overrides the request timestamp. Body scope: events[]. vendor.google-analytics.body.event_timestamp_age docs
item_id optional The vendor documents `item_id` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_id.invalid docs
item_name optional The vendor documents `item_name` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_name.invalid docs
affiliation optional The vendor documents `affiliation` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.affiliation.invalid docs
coupon optional The vendor documents `coupon` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.coupon.invalid docs
item_brand optional The vendor documents `item_brand` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_brand.invalid docs
item_category optional The vendor documents `item_category` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_category.invalid docs
item_category2 optional The vendor documents `item_category2` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_category2.invalid docs
item_category3 optional The vendor documents `item_category3` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_category3.invalid docs
item_category4 optional The vendor documents `item_category4` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_category4.invalid docs
item_category5 optional The vendor documents `item_category5` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_category5.invalid docs
item_list_id optional The vendor documents `item_list_id` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_list_id.invalid docs
item_list_name optional The vendor documents `item_list_name` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_list_name.invalid docs
item_variant optional The vendor documents `item_variant` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.item_variant.invalid docs
location_id optional The vendor documents `location_id` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.location_id.invalid docs
promotion_id optional The vendor documents `promotion_id` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.promotion_id.invalid docs
promotion_name optional The vendor documents `promotion_name` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.promotion_name.invalid docs
creative_name optional The vendor documents `creative_name` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.creative_name.invalid docs
creative_slot optional The vendor documents `creative_slot` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.creative_slot.invalid docs
discount optional The vendor documents `discount` in the request contract. Body scope: events[].params.items[]. Native JSON type: number. vendor.google-analytics.body.discount.invalid docs
index optional The vendor documents `index` in the request contract. Body scope: events[].params.items[]. Native JSON type: number. vendor.google-analytics.body.index.invalid docs
price optional The vendor documents `price` in the request contract. Body scope: events[].params.items[]. Native JSON type: number. vendor.google-analytics.body.price.invalid docs
quantity optional The vendor documents `quantity` in the request contract. Body scope: events[].params.items[]. Native JSON type: number. vendor.google-analytics.body.quantity.invalid docs
currency optional The vendor documents `currency` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.currency.invalid docs
google_business_vertical optional The vendor documents `google_business_vertical` in the request contract. Body scope: events[].params.items[]. Native JSON type: string. Maximum decoded characters: 500. vendor.google-analytics.body.google_business_vertical.invalid docs
root optional Measurement Protocol supports at most ten custom item parameters, excluding prescribed item fields. Body scope: events[].params.items[]. Native JSON type: object. Maximum object properties: 10. vendor.google-analytics.body.root.invalid docs
invalid_parameter_names… forbidden Parameter names must start with an alphabetic character and contain only alphanumeric characters or underscores. Body scope: events[].params.items[]. vendor.google-analytics.body.invalid_parameter_names.forbidden docs
overlong_item_parameter_names… forbidden Item parameter names are at most forty characters. Body scope: events[].params.items[]. vendor.google-analytics.body.overlong_item_parameter_names.forbidden docs
parameter_values… optional String parameter values are at most 500 characters on Analytics 360 and at most 100 on standard properties. This pack enforces the shared upper bound. Body scope: events[].params.items[]. Native JSON type: string or number or boolean or array or object or null. Maximum decoded characters: 500. vendor.google-analytics.body.parameter_values.invalid docs
body.item_identifier_required required The request does not satisfy the documented item identifier required requirement. Body scope: events[].params.items[]. vendor.google-analytics.body.item_identifier_required docs
root optional Body scope: user_properties.*. Native JSON type: object. vendor.google-analytics.body.root.invalid docs
value required Body scope: user_properties.*. Native JSON type: string or number. Maximum decoded characters: 36. vendor.google-analytics.body.value.missing
vendor.google-analytics.body.value.invalid
docs
timestamp_micros optional Body scope: user_properties.*. Native JSON type: integer. Minimum numeric value: 0. vendor.google-analytics.body.timestamp_micros.invalid docs
request_timestamp optional Body scope: user_properties.*. docs
request_validation optional Body scope: user_properties.*. docs
body.user_property_timestamp_age required With ENFORCE_RECOMMENDATIONS, the effective event or user-property timestamp cannot be earlier than 72 hours ago. A local timestamp overrides the request timestamp. Body scope: user_properties.*. vendor.google-analytics.body.user_property_timestamp_age docs
root optional Body scope: ["user_data.sha256_email_address[]","user_data.sha256_email_address"]. Native JSON type: string. vendor.google-analytics.body.root.empty
vendor.google-analytics.body.root.invalid
docs
root optional Body scope: ["user_data.sha256_phone_number[]","user_data.sha256_phone_number"]. Native JSON type: string. vendor.google-analytics.body.root.empty
vendor.google-analytics.body.root.invalid
docs
root optional Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: object. vendor.google-analytics.body.root.invalid docs
sha256_first_name optional The vendor documents `sha256_first_name` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.sha256_first_name.empty
vendor.google-analytics.body.sha256_first_name.invalid
docs
sha256_last_name optional The vendor documents `sha256_last_name` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.sha256_last_name.empty
vendor.google-analytics.body.sha256_last_name.invalid
docs
sha256_street optional The vendor documents `sha256_street` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.sha256_street.empty
vendor.google-analytics.body.sha256_street.invalid
docs
city optional The vendor documents `city` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.city.invalid docs
region optional The vendor documents `region` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.region.invalid docs
postal_code optional The vendor documents `postal_code` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.postal_code.invalid docs
country optional The vendor documents `country` in the request contract. Body scope: ["user_data.address[]","user_data.address"]. Native JSON type: string. vendor.google-analytics.body.country.empty
vendor.google-analytics.body.country.invalid
docs
method required This published ingestion operation uses HTTP POST. Complete HTTP capture contract. Native JSON type: string. vendor.google-analytics.http.method.missing
vendor.google-analytics.http.method.empty
vendor.google-analytics.http.method.invalid
docs
content_type recommended Use a published request media type. Complete HTTP capture contract. Presence diagnostic severity: warning. Value diagnostic severity: warning. Native JSON type: string. vendor.google-analytics.http.content_type.missing
vendor.google-analytics.http.content_type.empty
vendor.google-analytics.http.content_type.invalid
docs
body required The request body is a JSON object. Complete HTTP capture contract. Native JSON type: object. vendor.google-analytics.http.body.missing
vendor.google-analytics.http.body.invalid
docs
path required Measurement Protocol collects at the published collect or debug collect routes. Complete HTTP capture contract. Native JSON type: string. vendor.google-analytics.http.path.missing
vendor.google-analytics.http.path.empty
vendor.google-analytics.http.path.invalid
docs
query.firebase_app_id optional Firebase app-stream identifier in the request URL. Complete HTTP capture contract. Native JSON type: string. vendor.google-analytics.http.query.firebase_app_id.empty
vendor.google-analytics.http.query.firebase_app_id.invalid
docs
query.measurement_id optional Web measurement-stream identifier in the request URL. Complete HTTP capture contract. Native JSON type: string. vendor.google-analytics.http.query.measurement_id.empty
vendor.google-analytics.http.query.measurement_id.invalid
docs
body.client_id required Web streams require their client ID. Complete HTTP capture contract. Applies when {"kind":"present","param":"query.measurement_id"}. Native JSON type: string. vendor.google-analytics.http.body.client_id.missing
vendor.google-analytics.http.body.client_id.empty
vendor.google-analytics.http.body.client_id.invalid
docs
body.app_instance_id required Firebase app streams require their installation ID. Complete HTTP capture contract. Applies when {"kind":"present","param":"query.firebase_app_id"}. Native JSON type: string. vendor.google-analytics.http.body.app_instance_id.missing
vendor.google-analytics.http.body.app_instance_id.empty
vendor.google-analytics.http.body.app_instance_id.invalid
docs

Validate a payload

pixellint validate request @request.json --rulepack vendor/google-analytics

Try this failing payload in the playground. An example with a validation finding.

{
  "url": "https://www.google-analytics.com/mp/collect?api_secret=synthetic&measurement_id=G-ABC123",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": "{\"client_id\":\"123.456\",\"events\":[{\"name\":\"synthetic_event\",\"params\":{\"session_id\":1792886400,\"engagement_time_msec\":1}}],\"user_location\":{}}"
}

cargo install pixellint · npm install pixellint