Giter VIP home page Giter VIP logo

Comments (9)

dhufish avatar dhufish commented on July 21, 2024

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.

aawnu avatar aawnu commented on July 21, 2024

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.

aawnu avatar aawnu commented on July 21, 2024

@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.

aawnu avatar aawnu commented on July 21, 2024

Re-opens to notify on beta release.

from php-ga4.

dhufish avatar dhufish commented on July 21, 2024

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.

aawnu avatar aawnu commented on July 21, 2024

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.

dhufish avatar dhufish commented on July 21, 2024

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.

dhufish avatar dhufish commented on July 21, 2024

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.

aawnu avatar aawnu commented on July 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.