logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Monday, March 20, 2023 12:02:44 PM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 293

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Is there a reason Google Analytics 4 isn't registered as a widget? Everything else seems to be there that it needs.

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyar  
#2 Posted : Tuesday, March 21, 2023 5:41:37 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
The reason why Google Analytics 4 wasn't created as a widget is because of Google's requirements.

Google recommends placing the script into the HEAD tag and the widget cannot be placed in the HEAD tag.
The second reason is that the script has to be part of every page so just enabling/disabling from admin one time is much easier than placing/removing and managing the placement of the widget accordingly.

I hope this is clear.
Thanks
judy at Web2Market  
#3 Posted : Tuesday, March 21, 2023 5:48:42 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 293

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks. So enabling it is supposed to put it in the header tags automatically without having to do anything else? We just upgraded a site and and checked and it is enabled, but I don't see it when I view the source of the pages.
shaharyar  
#4 Posted : Tuesday, March 21, 2023 5:53:41 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
There are actually two conditions. It should be enabled from admin and MeasurementId is present. Without adding measurement Id the script will not render.
judy at Web2Market  
#5 Posted : Wednesday, March 22, 2023 3:48:38 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 293

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
After I posted this, the merchant put in a help desk ticket that he had implemented GA4 but no traffic was showing in his account.
He has entered his measurement id. I hadn't worked on his upgrade so maybe something was changed. Is anything else required?
I just tested on a 9.0.7 site I am starting to upgrade, but haven't done an work on yet, and it does work there.
shaharyar  
#6 Posted : Wednesday, March 22, 2023 4:04:33 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Using Ablecommerce, you have to follow these steps to render Google Analytics 4 script on the webpage.

1- Visit page site.com/Admin/Store/Tracking

2- Enable setting Enable GA4 Page Tracking

3- Add measurement Id and Save

4- Go to retail page and view page source. Confirm that the script is rendered in the head tag of the page.
judy at Web2Market  
#7 Posted : Wednesday, March 22, 2023 12:05:40 PM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 293

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for your answers. I found the issue. The line of code in the _BaseLayout of your 9.0.7 hadn't been put on their site. I put it there and the tags are showing now.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.