Re: GA-4 Analytics [Support Thread]
I'm getting this on a new install of ZC 2.1
--> PHP Warning: Undefined array key "products_name" in xxxx zc_plugins/GA4/v2.0.1/catalog/includes/classes/observers/ga4AnalyticsObserver.php on line 741.
I'm going to turn it off.. I see where it's supposed to get it on line 741.. not sure why it is not getting it.
Re: GA-4 Analytics [Support Thread]
Same Problem with GitHub Version
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
brian70809
I'm getting this on a new install of ZC 2.1
--> PHP Warning: Undefined array key "products_name" in xxxx zc_plugins/GA4/v2.0.1/catalog/includes/classes/observers/ga4AnalyticsObserver.php on line 741.
I'm going to turn it off.. I see where it's supposed to get it on line 741.. not sure why it is not getting it.
A copy of the full log with the backtrace information would help a lot, since it's the calling path that's introduced the issue.
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
lat9
A copy of the full log with the backtrace information would help a lot, since it's the calling path that's introduced the issue.
#0 /zc_plugins/GA4/v2.0.1/catalog/includes/classes/observers/ga4AnalyticsObserver.php(741): zen_debug_error_handler()
#1 /zc_plugins/GA4/v2.0.1/catalog/includes/classes/observers/ga4AnalyticsObserver.php(238): ga4AnalyticsObserver->getItemInfo()
#2 /includes/classes/traits/NotifierManager.php(106): ga4AnalyticsObserver->update()
#3 /includes/templates/wokiee/common/tpl_main_page.php(241): base->notify()
#4 /index.php(94): require('/home/afiwwe6sf...')
--> PHP Warning: Undefined array key "products_name" in /zc_plugins/GA4/v2.0.1/catalog/includes/classes/observers/ga4AnalyticsObserver.php on line 741.
Re: GA-4 Analytics [Support Thread]
Re: GA-4 Analytics [Support Thread]
ZC 2.0.1 with GA-4 analytics version 1.2.4
Not sure if it normal behavior or a bug but when looking the page source of main page, it appears the script is being loaded 2 times. Site is at www.royal-fleur(dot)com for reference
Code:
<html dir="ltr" lang="en" prefix="og: https://ogp.me/ns# fb: https://ogp.me/ns/fb# product: https://ogp.me/ns/product#">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JQL28SP4BW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-JQL28SP4BW');
</script>
<meta charset="utf-8">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JQL28SP4BW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-JQL28SP4BW');
</script>
<link rel="preload" href="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous" as="script">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous" as="style">
Is this normal behavior? If not how can i fix it?
Would upgrading to the latest version help? I am on ZC 2.0.1 so it may not be compatible.
Thank you for your time and help
Re: GA-4 Analytics [Support Thread]
You'll need to find which of the Google Tag Manager IDs belongs with the current site and remove the non-current.
While it probably doesn't affect site performance, Google does not recommend having more than one gtag.
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
dbltoe
You'll need to find which of the Google Tag Manager IDs belongs with the current site and remove the non-current.
While it probably doesn't affect site performance, Google does not recommend having more than one gtag.
What Google exactly says is:
keep the number of tags [...] as lean as possible
Most browsers will not open more than four to eight HTTP requests to a single domain at a time. If you have a high number of tags on the same domain firing under the same conditions, tags will only fire within this browser limitation.
https://support.google.com/tagmanage...72488?hl=en-GB
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
dbltoe
You'll need to find which of the Google Tag Manager IDs belongs with the current site and remove the non-current.
While it probably doesn't affect site performance, Google does not recommend having more than one gtag.
Quote:
Originally Posted by
Shop Suey
What Google exactly says is:
keep the number of tags [...] as lean as possible
Most browsers will not open more than four to eight HTTP requests to a single domain at a time. If you have a high number of tags on the same domain firing under the same conditions, tags will only fire within this browser limitation.
https://support.google.com/tagmanage...72488?hl=en-GB
Thank you both for the prompt assist.
I am only using the G4-Analytics plug in.
As you can see in the page source, the gtag id is the same in both location.
Code:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JQL28SP4BW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-JQL28SP4BW');
</script>
<meta charset="utf-8">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JQL28SP4BW"></script>
I made a test ( maybe pointless) but oddly if i change the gtag ID in the G4 Anlytic admin setting, the ID changes in both places.
I may just uninstall G4-anyltics to see if the script is still loaded. Not sure why the script would be loaded twice on the same page
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
nicksab
Thank you both for the prompt assist.
...
i love your response... although...
TIS.
Quote:
Originally Posted by
nicksab
...
Not sure why the script would be loaded twice on the same page
nick,
my 1st guess would be that potentially you have the same notifier in 2 places. why you would have that, i do not know.
i can only assume that @lat9 has tested this module, and that in a normal install, the behavior you are witnessing does not happen.
given that assumption, i would search your code base for:
NOTIFY_HTML_HEAD_TAG_START
that is the notifier that places your tag in the header. if that notifier occurs in 2 places that would explain the behavior.
your test (hardly pointless) suggests that the code where the tag gets inserted is getting hit twice.
but you definitely have some sort of issue, that i'm guessing is with your template.
in any event, that is where i would start.
best.