Re: GA-4 Analytics [Support Thread]
GA4 Analytics v1.2.0 is now available: https://www.zen-cart.com/downloads.php?do=file&id=2368
This release contains corrections for the following GitHub issues:
#11: Correct determination of products' information pages.
#12: Don't include a view_item event for invalid products.
#13: Need to load after currencies are instantiated, corrects PHP warning.
#14: Enable analytics to use either GA4 (gtag.js) or GTM (gtm.js) reporting.
#15: Don't log a PHP Warning if the required notification is missing.
#16: Include user_id for GTM reporting and enable site-specific customizations.
#17: Correct misspelling of item_name parameter for shopping-cart based items.
Re: GA-4 Analytics [Support Thread]
GA-4 Analytics v1.2.1 is now available for download.
This release contains changes associated with the following GitHub issues:
#18: Correct MySQL error (products_all) when Bootstrap template is in use.
Re: GA-4 Analytics [Support Thread]
Sorry for the churn, but v1.2.2 is now available for download.
This version corrects unwanted PHP warnings on the featured_products page.
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
lat9
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.
I reviewed the readme.html but it doesn't mention older versions. How does one install this on 1.5.5f?
Re: GA-4 Analytics [Support Thread]
Quote:
Originally Posted by
Techiant
I reviewed the readme.html but it doesn't mention older versions. How does one install this on 1.5.5f?
One doesn't! The plugin supports zc156 and later.
Re: GA-4 Analytics [Support Thread]
Is there another plug in that can handle GA4? Or a manual way to insert code in a header file?
Re: GA-4 Analytics [Support Thread]
The phrase "The plugin supports zc156 and later" means the plugin relies on internal Zen Cart code changes (often but not exclusively notifiers) that are only present in a specific release or higher.
1.5.5 is quite old and only runs on long-deprecated versions of PHP that are vulnerable to attack. You need to upgrade.
https://docs.zen-cart.com/user/upgrading/
Re: GA-4 Analytics [Support Thread]
I have installed the GA-4 Analytics update to Zen Cart 1.5.6c however I get an error in the log and Web site doesn't load
PHP Parse error: syntax error, unexpected '?' in /includes/classes/observers/class.ga4_analytics.php on line 309
case FILENAME_SPECIALS:
global $specials, $listing;
$products = $listing ?? $specials ?? []; <<line 309
if (empty($products)) {
break;
}
$_SESSION['ga4_analytics'][] = [
'event' => 'view_item_list',
'parameters' => [
'item_list_name' => GA4_ANALYTICS_SPECIALS,
'items' => $this->getListingItems($products),
]
];
break;
I have put the G- code in the GA4 Analytic admin field.
Any ideas?
Re: GA-4 Analytics [Support Thread]
You need to update the site to PHP 7.0 at a minimum. The null-coalesce operator (??) wasn't available until that PHP version.
Re: GA-4 Analytics [Support Thread]
Thought it might be something like that, but don't like updating PHP unless instructed.
Thank you
Updated Php version on server to 7 however I though I would see the change appear on the web site admin under the version menu?
But it still has PHP Version 5.6.40
Does it take a while to filter through?