Google Conversion Plugin error

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 14 Nov 2022, 12:04

Google Conversion Plugin error

Post by keep2000 »

Hello

first question: Phoca Cart-related plugin support belongs to this topic or Phoca Cart topic? :)

I work with a Yootheme pro template which supports embeding google analytics code from it's core, it does work well. I also installed 'Google Conversion Plugin', but I got error: "gtag is not defined".
Do I need to change something? I noticed that the conversion script is before the ga4 code. How can I move the conversion after the analytics code is loaded?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Google Conversion Plugin error

Post by Jan »

Hi, try to change the ordering of the plugin, so it is ordered after the script with ga4 code.

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 14 Nov 2022, 12:04

Re: Google Conversion Plugin error

Post by keep2000 »

Thanks, but Google Conversion Plugin is a pcv plugin, and I'm not sure how yootheme puts the code there, I assume it's their system plugin. I can't mix the ordering of two plugins with different types, can I? :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Google Conversion Plugin error

Post by Jan »

Hi, yes, you are right, this will be not possible to order system and view plugin together. The question is why the system plugin does no render this info as first :idea:

Are you able to test it with another plugin, e.g. add the code with help of Phoca Site plugin:
https://www.phoca.cz/phoca-site-plugin

Jan
If you find Phoca extensions useful, please support the project
keep2000
Phoca Enthusiast
Phoca Enthusiast
Posts: 50
Joined: 14 Nov 2022, 12:04

Re: Google Conversion Plugin error

Post by keep2000 »

Same result with phoca site plugin.
Ps: I work with Joomla 5 if it does change something

Ps2:
I just wraped the gtag event with window.addEventListener(\'load\', function() { ... }); in the pcv plugin and it seems working for now
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48299
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Google Conversion Plugin error

Post by Jan »

Hi, thank you very much for the info, I will take a look at it for the plugin.

Jan
If you find Phoca extensions useful, please support the project
Post Reply