We had over 80 conversions in June, but GA4 is only recording 8 of them. Given that we have different currencies and almost all of them are represented in the correctly recorded purchases, it doesn’t seem to be a currency issue. We are sending currency and other parameters as required, as you can see below.
I have reviewed all the transactions and couldn’t find any coherence between those that were recorded correctly or those that weren’t. Has anyone else experienced this issue or does anyone know how we can resolve it?
Thanks
public static function getPurchaseData(Invoice $invoice ) : Collection
{
$event = ‘purchase’;
$itemsWithType = $invoice->getItemsWithType();
$services = $itemsWithType->services->values();
$paidTransaction = $invoice->paidTransaction;
if($services->count() === 0 || is_null($paidTransaction)){
return collect([
‘event’ => $event,
‘ecommerce’ => collect([])
]);
}
$upsellings = $itemsWithType->upsellings->values();
$products = [];
$services
->values()
->each(function ($service) use (&$products,$invoice) {
$products[] = [
‘item_name’ => $service->description,
‘item_id’ => (string) $service->getKey(),
‘price’ => Price::getPriceFromEuro($service->total_price,$invoice->currency),
‘item_category’ => $service->category,
];
});
$upsellings
->each(function (DealsWithInvoice $service) use (&$products) {
$products[] = [
‘item_name’ => $service->description,
‘item_id’ => (string) $service->getKey(),
‘price’ => $service->total_price,
‘item_category’ => $service->category,
];
});
$coupon = $invoice->coupon;
$gtagData = collect();
$gtagData->put(‘transaction_id’, $paidTransaction->getKey());
$gtagData->put(‘currency’, $invoice->currency->code);
$gtagData->put(‘value’, (float) $invoice->amount);
if($coupon){
$gtagData->put(‘coupon’, $coupon->code);
}
$gtagData->put(‘items’, $products);
return collect([
‘event’ => $event,
‘ecommerce’ => $gtagData
]);
}
I checked if parameters are sent correctly. and they were.
I also checked debug view in GA4 and preview mode of Tag manager and both recorded the test purchase I did.
user3883888 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.