XF 2.2 Add Google Analytics 4

polle

Active member
How to add the new Google Analytics 4 code?

When trying the new format this pops up:

Code:
Please enter your Google Analytics web property ID / UA number in the format UA-XXXXXX-Y.

Thanks.
 

polle

Active member
Thanks @nicodak

Yes, in the old one I have the new one connected.

Old one, everything shows up.
New one, there are no stats at all, no live users, nothing.

In other sites with the exact same config (but using the new code), everything shows correctly in the new one.

So it seems that it can be connected, but in order to actually work, you have to use the new code in the sites.
 

polle

Active member
Your forum: old analytics code
Analytics 4: You go to the new analytics and see everything working?

Because yes, the old one still works, the idea is to use the new one.

Thanks.
 

Nicolas FR

Well-known member
Yes if you see my source code page you will see the old tag, but in GA version 4 i can see datas. Not so much datas because my forum is all new and i associated the new tag this night. But i can see realtime datas without any problem.
 

polle

Active member
Not in mine.

It is not that I don't trust the association system, is that if I use the new code it works, if not, it doesn't.

Just to confirm. You go to the OLD one in Analytics, click Upgrade to GA4 and you see there Connected Property, which is the new one.

Thats it, correct?

Thank you.
 

polle

Active member
That is in the OLD or in the NEW?

Because you are using G- which indicates you are in the OLD one and adding that.

Can you please share the location of that page? Because I only see it in the NEW settings.

Thanks.
 

Nicolas FR

Well-known member
Open the Analytics page (old one) then go to ADMINISTRATION > PROPERTY TAB > FOLLOWING INFORMATION > FOLLOWING CODE > ASSOCIATED SITES TAGS and you will see exactly the attachment i posted my message.

Old tag begin by UA-
New tag begin by G-

In my attachement i'm in old GA page and i can see the new tag associated
 

polle

Active member
It is a bit confusing. For anyone looking into connecting the new with the old one:

In the old one go to: Admin > Tracking Info > Tracking code

Click Connected Site Tags

Add there the new one starting with G.

That is for using an old one and not with a new created one and it seems you can only use one or the other under:

Add new on-page tag / Use existing on-page tag

Connecting the OLD one to the NEW one does not work. So everything is confusing.

The best solution is to just use the new one, but that has to be in the PAGE_CONTAINER as mentioned above.
 

Nicolas FR

Well-known member
I really don't understand what's wrong in your case.
You activate GA4 then a new tag is created then you go to the old GA page and you associate the new tag with the old one and it works.
Sorry for my bad english, probably i'm not explain very well.
 

polle

Active member
It is working now.

You have to associate in the old as I shared above. Realtime works different in each version, but at least it seems is working now.

Thank you for your help!
 

djbaxter

in memoriam 1947-2022
You can associate the new GA4 ID with the old in GA settings. You don't have to change anything in XF ACP for the moment.
Yes. I just did this for all my sites last night. One alert: the conversion scripts are still buggy. Google popped up a couple of erroneous error messages (saying incorrectly that I wasn't the owner or didn't have permissions, that sort of thing) but the conversion went through correctly anyway.
 
Top