Comments (9)
I found a problem with my event, the array index 'add_to_cart' is incorrect, I changed it to 'AddToCart' to match the correct class name...
I am now facing this...
AlexWestergaard\PhpGa4\Event\AddToCart::addItem(): Argument #1 ($item) must be of type AlexWestergaard\PhpGa4\Facade\Type\Item, array given
I suspect my $event array is not correctly formed and is causing the problem here... from my axios post I am creating it with...
$event = $request->all();
What is the best way to pass this in to Converter::parseEvents()?
from php-ga4.
Hello,
Would you mind passing the request body you push to the converter? Then I will have a look and see what I can do 🥳
Edit: just saw you passed the array, I'll look at it
from php-ga4.
@dhufish I have located the flaw in my conversion. It did not render item array into item model before applying it to the event model. This will be fixed in the next version.
PLEASE read the release statements as there have been major changes in the past few releases to improve the readability of this library.
NOTE I will let you know when I release 1.1.3-beta so that you can use this update ASAP.
from php-ga4.
Re-opens to notify on beta release.
from php-ga4.
Thank you for the update I appreciate you taking the time to respond quickly. I will keep an eye out 1.1.3-beta and provide feedback when available. 😎
from php-ga4.
Hello @dhufish
I have released v1.1.3-beta, make sure to test it out locally first to make sure you are up to date with latest changes. You can run this pre-release by 1.1.3-beta
as composer version.
from php-ga4.
Hi @aawnu, Thank you again for looking in to this issue, I updated to 1.1.3-beta and ran some add_to_cart tests and they appeared in the GA4 realtime dashboard 👍 I'm adding more events over the next week so I'll keep you updated if any issues. Much appreciated and I look forward to contributing to your project.
from php-ga4.
Hi @aawnu, I tried two more events and both silently failed to appear in GA4 dashboard... BeginCheckout and Purchase... no errors were thrown, here are the events that were passed...
0 =>
AlexWestergaard\PhpGa4\Event\BeginCheckout::__set_state(array(
'isCloning' => false,
'currentIteratorKey' => 0,
'allIteratorKeys' =>
array (
0 => 'language',
1 => 'page_location',
2 => 'page_referrer',
3 => 'page_title',
4 => 'screen_resolution',
5 => 'currency',
6 => 'value',
7 => 'coupon',
8 => 'items',
),
'campaign' =>
array (
),
'currency' => 'AUD',
'value' => 38.0,
'items' =>
array (
0 =>
array (
'item_id' => '13',
'item_name' => '500g Hey Girl',
'item_category' =>
array (
0 => 'Pre Made Candy',
),
'price' => 38.0,
'quantity' => 1,
),
),
))
0 =>
AlexWestergaard\PhpGa4\Event\Purchase::__set_state(array(
'isCloning' => false,
'currentIteratorKey' => 0,
'allIteratorKeys' =>
array (
0 => 'language',
1 => 'page_location',
2 => 'page_referrer',
3 => 'page_title',
4 => 'screen_resolution',
5 => 'currency',
6 => 'transaction_id',
7 => 'value',
8 => 'affiliation',
9 => 'coupon',
10 => 'shipping',
11 => 'tax',
12 => 'items',
),
'campaign' =>
array (
),
'currency' => 'AUD',
'transaction_id' => '8',
'value' => 38.0,
'items' =>
array (
0 =>
array (
'item_id' => '13',
'item_name' => '500g Hey Girl',
'item_category' =>
array (
0 => 'Pre Made Candy',
),
'price' => 38.0,
'quantity' => 1,
),
),
))
from php-ga4.
@dhufish please make new issues when a ticket is closed, because it does not come up. Only saw it because I have emails activates on all.
from php-ga4.
Related Issues (20)
- Refactor structure and use of facades/abstraction
- rationale for Analytics::new() HOT 2
- Add document title HOT 3
- Add core events of GA.js/GTAG.js as SST-Events HOT 1
- begin_checkout HOT 1
- begin checkout HOT 2
- If you follow the code then you will see there is 3 layers. HOT 1
- README _gid cookie question HOT 1
- question: How to get data to show up in debug? HOT 3
- Dashboard not reflecting the posted report HOT 1
- User Properties - Question HOT 1
- Status of page_view event HOT 2
- User location HOT 1
- Client id must have been created by gtag.js? HOT 2
- Server only tracking, user tracking? HOT 6
- PHP 8.3 support HOT 2
- Item -> item_category - Validation error [VALUE_INVALID] HOT 3
- Missing measurement ID exception throws incorrect error message HOT 1
- ask for help HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-ga4.