- This topic has 7 replies, 4 voices, and was last updated 3 years, 2 months ago by
David.
-
AuthorPosts
-
January 18, 2023 at 1:25 am #2499786
Luke
Hello
I want to install new tracking ID on my blog for Google Analytics (you know GA4).
I installed my old ID using All In One SEO Pack plugin, but I’m not sure how to do it now. Of course I don’t want to switch to using GA4 right now, I still want to be using Universal Analytics, but I know that both of them can work simultaneously and they don’t interfere with each other.When I’m using Generate Press is there a better way to install this code than using All In One SEO plugin? Can you recommend me something?
January 18, 2023 at 1:32 am #2499794Fernando Customer Support
Hi Luke,
You can use a Hook for this.
Basically, you just need to add your GA4 code through a Hook Element. Conceptually, the process would be the same as it is for GTM: https://docs.generatepress.com/article/implement-google-tag-manager/
This is one approach to do it through GeneratePress without using a third-party plugin.
January 18, 2023 at 2:01 am #2499815Luke
OK, when I clicked the link the instructions say to do this:
Go to Appearance > Elements and click “Add New”.
From the Element dropdown list, choose “Hook”.
Copy and paste the your own code into the content area.
Under Settings tab, select wp_head in the Hook dropdown list.
Under Display Rules tab, select Entire Site in the Location dropdown list.
Click the Publish button then we are half way done.Then below I see similar instructions:
Go to Appearance > Elements and click “Add New”. From the Element dropdown list, choose “Hook”.
Copy and paste the your own code into the content area.— Does it mean I’m supposed to do the same thing twice?
What about the 2 blocks of codes? Do I need to copy and paste them somewhere?
I’ve just noticed that the GA code appeared in the left upper corner of my site on the Homepage. I think I’m doing something wrong!
January 18, 2023 at 4:09 am #2499963David
StaffCustomer SupportHi there,
in your GA account – copy the Global site tag (gtag.js) script.
in WordPress -> Appearance > Elements -> Add a New Element -> Hook.
Paste in your script into the text area.
Set the Hook element to thewp_head
Set the Display Rules.Thats all that is required for Google Analytics.
The 2 part method in that doc is only required if you’re using Google Tag Manager.
You can read more here on GTM and GA:
https://www.searchenginejournal.com/google-tag-manager-ga4-guide/396169/January 18, 2023 at 4:32 am #2499997Luke
OK, I’m in the Display Rules tab now.
Should I choose Entire Site in the Location?
I suppose I don’t have to do anything with Exclude and Users?
January 18, 2023 at 5:19 am #2500039David
StaffCustomer SupportSet it to the Entire Site.
And leave the other options alone 🙂January 22, 2023 at 5:13 pm #2505227Scott
You should sticky this!
January 23, 2023 at 3:50 am #2505632David
StaffCustomer SupportI think we need to update our docs lol
I must say Google could make this kind of change a little clearer … i had to treble check it 🙂 -
AuthorPosts
- You must be logged in to reply to this topic.