Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default GA-4 Analytics [Support Thread]

    Re-creating the support thread, since the original one "went missing".

    The GA-4 Analytics plugin (available at https://www.zen-cart.com/downloads.php?do=file&id=2368) can be used on Zen Cart sites using 1.5.6b through 1.5.8 without issue. For 1.5.6b installations (or non-standard/older templates), be sure to read the readme since there are a couple of notifications that must be added to template files for the GA-4 Analytics' observer class to do its thing.

    Other than that, no core file overwrites, just a couple of configuration settings in your admin.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: GA-4 Analytics [Support Thread]

    Small problem on account history info page; issue created in Github wi/log.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: GA-4 Analytics [Support Thread]

    Users of older GA plugins may wish to delete the entry under Admin > Configuration for Universal Analytics. For Simple GA it can be done by removing

    admin/includes/extra_datafiles/google_analytics_database_names.php
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: GA-4 Analytics [Support Thread]

    Quote Originally Posted by swguy View Post
    Users of older GA plugins may wish to delete the entry under Admin > Configuration for Universal Analytics. For Simple GA it can be done by removing

    admin/includes/extra_datafiles/google_analytics_database_names.php
    Thanks, @swguy. I'll add this to the plugin's documentation.

  5. #5
    Join Date
    Jul 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: GA-4 Analytics [Support Thread]

    Hi,

    I have just yesterday installed ZC 1.5.8a and GA4.
    I have found many DEBUG files in log directory.

    All errors are this form:
    [29-Mar-2023 16:22:41 UTC] Request URI: /index.php?main_page=product_reviews_write&products_id=11, IP address: 65.108.2.171, Language id CZK
    #0 /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php(79): zen_debug_error_handler()
    #1 /pub/amforawa/vialux.cz/web/www/includes/autoload_func.php(47): ga4_analytics->__construct()
    #2 /pub/amforawa/vialux.cz/web/www/includes/application_top.php(237): require('...')
    #3 /pub/amforawa/vialux.cz/web/www/index.php(25): require('...')
    --> PHP Warning: Undefined array key "currency" in /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php on line 79.

    on the row 79 in the ga4_analytics.php is this code:

    $this->currency_decimal_places = $currencies->currencies[$_SESSION['currency']]['decimal_places'];

    I find this code right, but understand what is wrong.
    $_SESSION['currency'] is "CZK" and the decimal_places is ind the DB set to 2.
    when I change the row 79 to this, it will works

    $this->currency_decimal_places = 2;

    so the problem is in the class Currencies, but I don't understav why.

    can you help me?
    than k you Dalibor

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: GA-4 Analytics [Support Thread]

    I have also seen this on one site (but not others). My workaround was to force-set that variable.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  7. #7
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: GA-4 Analytics [Support Thread]

    Quote Originally Posted by Borek View Post
    Hi,

    I have just yesterday installed ZC 1.5.8a and GA4.
    I have found many DEBUG files in log directory.

    All errors are this form:
    [29-Mar-2023 16:22:41 UTC] Request URI: /index.php?main_page=product_reviews_write&products_id=11, IP address: 65.108.2.171, Language id CZK
    #0 /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php(79): zen_debug_error_handler()
    #1 /pub/amforawa/vialux.cz/web/www/includes/autoload_func.php(47): ga4_analytics->__construct()
    #2 /pub/amforawa/vialux.cz/web/www/includes/application_top.php(237): require('...')
    #3 /pub/amforawa/vialux.cz/web/www/index.php(25): require('...')
    --> PHP Warning: Undefined array key "currency" in /pub/amforawa/vialux.cz/web/www/includes/classes/observers/class.ga4_analytics.php on line 79.

    on the row 79 in the ga4_analytics.php is this code:

    $this->currency_decimal_places = $currencies->currencies[$_SESSION['currency']]['decimal_places'];

    I find this code right, but understand what is wrong.
    $_SESSION['currency'] is "CZK" and the decimal_places is ind the DB set to 2.
    when I change the row 79 to this, it will works

    $this->currency_decimal_places = 2;

    so the problem is in the class Currencies, but I don't understav why.

    can you help me?
    than k you Dalibor
    i disagree. i think the problem is with your $_SESSION['currency'] var. the error is saying that array value is not set.

    if one looks at when the currencies get set, it is at load point 120.

    the ga-4 analytics code gets set at load point 90.

    the ga-4 analytics needs to be loaded AFTER the currencies get loaded in order that the currency value of the SESSION array is available.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: GA-4 Analytics [Support Thread]

    Agreed, @carlwhat, GitHub issue opened: https://github.com/lat9/ga4-analytics/issues/13

    The issue can be corrected via edit to /includes/auto_loaders/config.ga4_analytics.php, changing this section
    Code:
    $autoLoadConfig[90][] = [
        'autoType' => 'class',
        'loadFile' => 'observers/class.ga4_analytics.php'
    ];
    $autoLoadConfig[90][] = [
        'autoType' => 'classInstantiate',
        'className' => 'ga4_analytics',
        'objectName' => 'ga4_analytics'
    ];
    to read
    Code:
    $autoLoadConfig[120][] = [
        'autoType' => 'class',
        'loadFile' => 'observers/class.ga4_analytics.php'
    ];
    $autoLoadConfig[120][] = [
        'autoType' => 'classInstantiate',
        'className' => 'ga4_analytics',
        'objectName' => 'ga4_analytics'
    ];

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: GA-4 Analytics [Support Thread]

    Nicely done @carlwhat!
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #10
    Join Date
    Jul 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: GA-4 Analytics [Support Thread]

    Yes, thanks.

    There I don't search the problem.
    I have set the index as the last one that I have in my config.core.php

    have a nice day
    Borek

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 19
    Last Post: 23 Jan 2023, 08:04 AM
  2. Easy Google Analytics - Support
    By kamion in forum All Other Contributions/Addons
    Replies: 41
    Last Post: 17 Nov 2022, 03:18 PM
  3. Simple Google Analytics - Support
    By cuda in forum All Other Contributions/Addons
    Replies: 2160
    Last Post: 22 Dec 2020, 05:38 AM
  4. v156 PWA, Offline support Push notifications addon [Support Thread]
    By perfumbg in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 May 2019, 02:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR