Dear Alex or Dan,
I am writing to seek assistance with diagnosing and resolving an issue related to add_to_cart
event tracking on my website, managed via Google Tag Manager (GTM).
I’ve observed that upon triggering an add_to_cart
event in the Data Layer, two distinct HTTP requests are generated and sent to Google’s servers, each yielding a different response:
- Request 1 (GA4 Event):
- Endpoint:
https://region1.analytics.google.com/g/collect?
- Response Status:
302 Found
- Observation: This status is expected and indicates successful processing for standard GA4 events. Data from the Data Layer (including the
items
array andvalue
,currency
parameters) is correctly formatted and accepted by the server. Notably, anindex: null
parameter within theitems
array is accepted without issues in this request, similar to myview_item_list
event which consistently returns a 204 status.
- Request 2 (Likely Google Ads Conversion):
- Endpoint:
https://www.google.com/measurement/conversion/?
- Response Status:
400 Bad Request
- Observation: This error indicates that the format or content of the request sent to this specific endpoint is either incorrect or does not meet its validation requirements.
Current Setup:
- In GTM, I have a Google Analytics 4: Event tag configured for
add_to_cart
, which pulls data fromeventModel.items
andeventModel.value
in the Data Layer. - The Data Layer push for
add_to_cart
is structured as follows:JavaScript
dataLayer.push({
event: "add_to_cart",
eventModel: {
items: [
{
item_name: "Miód z miętą i cytryną",
item_id: "1351",
item_brand: "",
item_category: "Miody z dodatkami",
item_variant: "",
item_list_name: "detailview",
index: null, // Also present and accepted in the working view_item_list event
price: 29.9,
currency: "PLN",
quantity: 1
}
],
currency: "PLN",
value: 29.9
},
"gtm.uniqueEventId": 259
})
- I suspect the second request (the one returning the 400 error) is being generated by a Google Ads Conversion tag or another remarketing tag that also fires on the
add_to_cart
event.
My Question:
Given that the Data Layer data is correctly processed by the GA4 endpoint (/g/collect
), I would appreciate your assistance in identifying the specific reason for the 400 Bad Request for the request sent to the https://www.google.com/measurement/conversion/
endpoint.
What are the typical requirements or data format differences for this particular endpoint in the context of an add_to_cart
event that might lead to this error, even though the same data is accepted by the standard GA4 endpoint? Please provide guidance on which parameters or their format I should specifically review in the configuration of the tag responsible for this second request.
Thank you in advance for your assistance.