-
AuthorPosts
-
July 6, 2022 at 9:55 pm #1357458
Hi,
I am adding the Google Analytics tracking code within Enfold > Google Services
Historically, this has always been UA code. My client has supplied my Global Site tag coding as the Analytics defaults to GA4 property now.
Does the Global site tag code work the same as UA code?
See the code supplied. Is this OK?
Thanks
MarcusJuly 8, 2022 at 8:26 am #1357628Hey woogie07,
Thank you for the inquiry.
Does the Global site tag code work the same as UA code?
Yes, the new analytics tag is also recognized by the theme and will work the same as the old UA code. You can add the whole script in the field or just use the unique tag (G-**) ID.
Best regards,
IsmaelJuly 8, 2022 at 12:01 pm #1357677Thanks
If I have another script that I need to add, where in the is best to place the script in the header php?
Can you send a screen capture for where to place?
Thanks
MarcusJuly 8, 2022 at 1:42 pm #1357702Hi,
If the new code is supposed to be added to the header section of your site, then you can try to add it in the Analytics box as well. You could also add it using a function:
function woogie07_custom_header_code(){ ?> YOUR SCRIPT GOES HERE <?php } add_action('wp_head', 'woogie07_custom_header_code');
Best regards,
RikardJuly 8, 2022 at 1:53 pm #1357707Hi Rikard
So I can add the code in the Google analytics box within Google Services, In addition to the Google analytics code I already have?
See content and advise if this is correct?Ref if I pout the script in the header.php
Does the code go in a certain place? eg code goes where the wording is below: Scripts/CSS and wp_head hook?>
<!– Scripts/CSS and wp_head hook –>
<?php
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/wp_head();
July 8, 2022 at 3:58 pm #1357721Hi,
You can try to see if it works in the Analytics field. If not, then try using the function instead.
Best regards,
RikardJuly 8, 2022 at 4:15 pm #1357722thanks
Where is best positioning for code in header.php?
July 8, 2022 at 5:49 pm #1357727Hi,
Both methods should yield the same results, unless the code needs to be in a specific place before or after some other code.
Best regards,
RikardJuly 27, 2022 at 7:27 pm #1359601Hi,
The extra script that I added for zoho in the Google Analytics box does not seem to be working.
Would you suggest I add in the header php – it is not clear on head php where script goes?
I am not running child theme so unsure the best route?
Please advise
Thanks
MarcusJuly 27, 2022 at 8:13 pm #1359606Hi,
Please try using the function I posted in this reply. If you are not running a child theme, then any edits you might have done to function.php for example, will be overwritten when you update the theme.
Best regards,
RikardAugust 2, 2022 at 6:02 pm #1360339Hi,
see below\\Thanks
MarcusAugust 2, 2022 at 8:15 pm #1360355 -
AuthorPosts
- You must be logged in to reply to this topic.