Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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
    Marcus

    #1357628

    Hey 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,
    Ismael

    #1357677

    Thanks

    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
    Marcus

    #1357702

    Hi,

    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,
    Rikard

    #1357707

    Hi 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();

    #1357721

    Hi,

    You can try to see if it works in the Analytics field. If not, then try using the function instead.

    Best regards,
    Rikard

    #1357722

    thanks

    Where is best positioning for code in header.php?

    #1357727

    Hi,

    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,
    Rikard

    #1359601

    Hi,

    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
    Marcus

    #1359606

    Hi,

    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,
    Rikard

    #1360339

    Hi,
    see below\\Thanks
    Marcus

    #1360355

    Hi,

    No, don’t change anything in the function except this text:

    YOUR SCRIPT GOES HERE

    Replace that text with the actual script.

    Best regards,
    Rikard

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.