Reputation: 21
I am using GTM on our Product Cart website to fire a GA4 event tag called Product Cart Purchase, with the event name purchase_from_cart
. When users complete a purchase, they are redirected to a page on the site with /designer-download
in the URL path, and the query string contains all the info I need for the ecommerce analysis. Instead of using the data layer, I have defined custom variables using the URL query string and composed a custom Javascript variable called ecommerce_object
.
In the Ecommerce configuration of this tag, I have Send Ecommerce Data
checked, with the Data source
as Custom Object
, Ecommerce Object
is the value of the {{ecommerce_object}}
, and the ecommerce_object
value is generated like this:
function() {
return {
transaction_id: {{transaction_id}},
value: {{signup_revenue}},
currency: "USD",
items: [
{
item_id: {{product_id}},
item_name: {{item_name}},
currency: "USD",
price: {{signup_revenue}}
}
]
};
}
The values {{transaction_id}}
, {{signup_revenue}}
, {{product_id}}
are derived from the query parameters, and {{item_name}}
is derived from another Javascript custom variable translating the {{product_id}}
to a string naming the product. But when I look at the Monetization: Ecommerce Purchase report in Google Analytics, it has no data.
Here's what I've tried:
GTM preview: Verifies that the tag is firing at the appropriate time and that the parameter values are populated correctly, including the ecommerce_object
GA4 debug view: Shows the product*\_*cart\_purchase event firing with the parameter values intact.
My ecommerce object has the minimum required data for ecommerce analysis: transaction id, value, currency, array of item objects, and each item object has product id, item name and price.
What am I missing?
Upvotes: 0
Views: 201
Reputation: 1
Events you give custom names to won't populate the pre-generated reports. To work with the reports built in to GA4, you need to use the event names recommended in the documentation.
If you call the event_name purchase
instead of purchase_from_cart
that should get into the monetization report.
Upvotes: 0