Viewing 30 posts - 1 through 30 (of 33 total)
  • Author
    Posts
  • #1146050

    Hi,

    I need to put the Global Google tag in my Enfold theme for remarketing, but I’m not sure how to do it. It supposes that I have to add the tag in <head> of each page, but I’m not able to see the head code.

    Could you help me please?

    P.S: I have the last version of Enfold .

    #1146092
    #1154029

    Hi,

    I still don’t know how to add the code on my website :[
    I need to add the global tag in the home and the event tag in one page.

    Could you help me please?

    Thanks.
    Oscar

    #1154177

    Hi,

    What code do you need to add and where exactly?

    Best regards,
    Rikard

    #1154209

    Hi,

    This is the code I need to add (Private content)

    #1154210

    Sorry, the code must be between <head></head> of each page.

    #1154468

    Hi,

    Did you try adding it to header.php?

    Best regards,
    Jordan Shannon

    #1154476

    Hi Jordan,

    No, I didn’t. If I add the code in the header, doesn’t it add in complete website?

    The Google support said to put the global tag just in the home and the event tag on the page I need the conversion.

    Best regards,
    Oscar

    #1154631

    Hi Oscar,

    Please try this function at the bottom of your functions.php file for the gtag code:

    function ovacam_add_gtag(){
    ?>
    //Your script code goes here
    <?php
    }
    add_action('wp_head', 'ovacam_add_gtag');

    If the other code needs to be added to only one page then we need the ID of it, you can find that in the URL when you edit the page in question for example, or in the body tag on the front end.

    Best regards,
    Rikard

    #1154909

    Hi Rikard,

    Thank you.
    The ID is 3672.

    I look forward to your answer.
    Best regards,
    Oscar

    #1154911

    One question. Is the code correct?

    function ovacam_add_gtag(){
    ?>
    <!– Global site tag (gtag.js) – Google Ads: 924505948 –>
    <script async src=”https://www.googletagmanager.com/gtag/js?id=AW-924505948″></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘AW-924505948’);
    </script>
    <?php
    }
    add_action(‘wp_head’, ‘ovacam_add_gtag’);

    #1155146

    Hi,

    Yes that looks correct, you can remove the comment tag as well:

    <!– Global site tag (gtag.js) – Google Ads: 924505948 –>

    Best regards,
    Rikard

    #1155147

    Hi again,

    Try this function for your other script on the conversion page:

    function ovacam_add_conversion_page(){
      if(is_page( 3672 )) {
      ?>
      <script>
        gtag(‘event’, ‘conversion’, {‘send_to’: ‘AW-924505948/zCEmCOzn9rIBENyu67gD’});
      </script>
      <?php
      }
    }
    add_action('wp_head', 'ovacam_add_conversion_page');

    Best regards,
    Rikard

    #1155191

    Great Rikard!
    I have added the gtab and the event tag in functions.php. Is this correct?

    From Google support say that in order to check the code is installed correctly, see font code from Google Chrome and it should appears the code, but I checked and I do not see neither of both.

    Could you help me to check if I did well?

    I would be grateful to you.
    Oscar

    #1155297

    Hi Oscar,

    Yes they should work in functions.php, we don’t have access to your site so we can’t really say if what you have done is wrong or right. Please post admin login details in private so that we can have a closer look.

    Best regards,
    Rikard

    #1155742

    Hi Rikard,

    After adding the code as you said me, there are not conversions, so I understand it’s no working well.

    I post the admin login.

    I look forward to your answer.
    Best regards,
    Oscar

    #1155840

    Hi,

    Thanks for that, I can’t see any reason as to why the functions would not work. Maybe it’s due to to your caching plugin? What happens if you deactivate that?

    Also, please note that what you add in to the parent theme will be overwritten on updates. You might want to consider adding a child theme: https://kriesi.at/documentation/enfold/child-theme/

    Best regards,
    Rikard

    #1155863

    Hi,

    So, did you mean that the code is correctly installed?

    I just disactivated the cache plugin and checked the conversion, but Google shows as unverified. :/

    This is the meaning of Unverified (Extract Google):
    Unverified: We haven’t verified that your tag has been put on your website yet. This takes a few hours. To make sure we see your tag, you can visit your conversion page (for example, the page confirming a purchase or mailing list sign-up). If it’s been more than 24 hours and you still see this status, skip to Confirm and verify your conversion tracking tag below.

    On the other hand, I have already installed a child theme, althoug I think it is not properly installed, because the style is not the same.

    Best regards,
    Oscar

    #1156255

    Hi Oscar,

    You need to export the settings from your parent theme under Enfold->Import/Export, then import the settings when the child is active. If they don’t apply straight away then please try to change one or two settings in the theme and save again. Also remember to clear all caches.

    Best regards,
    Rikard

    #1156320

    Hi Rikard,

    I did what you said and now is almost the same. However it does not apply some style items, like the font type and the colour area. I think only those things are not applyied.

    I have checked Advanced Styles in child theme and the fonts are installed correctly, so I don’t understand why

    You can see the screenshots of parent and child themes.

    I have a doubt about child theme. When this is active, I understand that the url of website goes to child theme, am I right?
    If that is correct, in order to check de gtag the child theme should be active for a while to check the conversion, right?

    Thank you very much for your support.
    Oscar

    #1156602

    Hi Oscar,

    I see the same thing on my end when I activate the child theme unfortunately, I’m not sure why your parent settings don’t carry over. I’ll ask the rest of the team to have a look too. Your caching/optimisation plugins might be at fault here, I tried deactivating them but nothing changed after that.

    Best regards,
    Rikard

    #1156679

    Hi Rikard,

    Thank you, I appreciate it.

    I look forward to your answer then.
    Best regards,
    Oscar

    #1156766

    Hi Oscar,

    I tried deleting and re-uploading your child theme however it does not show up in Appearance > Themes tab. Could you please post FTP logins here privately as well?

    Best regards,
    Yigit

    #1156776

    Thank you Yigit. I post them below.

    Best regards,
    Oscar

    #1156781

    Hi,

    I am getting time out error. Could you please check if server in private content field is correct?
    That field is only visible to you and moderators :)

    Best regards,
    Yigit

    #1156782

    Sorry Yigit, it was the logout url

    #1157458

    Hi,
    Thank you for the cPanel and WordPress logins, I have taken a look at your site and I adjusted your child theme so that it work correctly, the issue was that your parent theme was not in the default directory. I then moved your gtag scripts to the child theme functions.php and corrected the curly quotes in the code, and cleared your Autoptimize cache, and tested to ensure your scripts loaded correctly, which they do now.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1157957

    Hi Mike,

    Thank you very much for all your help, I’m very gratefull.

    I’ve just clear the browser cache and the web is loading correctly.
    Now it seems that google detects gtag with child theme. Should I add the gtag code in the parent theme now or it’s not necessary?

    Best regards,
    Oscar

    #1158151

    Hi,
    Glad to hear, you do not need to add to the parent theme as long as your child theme is active, a child theme is much better as you will not lose this code after your next update.
    Shall we close this then?

    Best regards,
    Mike

    #1158168

    Hi Mike,

    Yes, you can close this ticket. Just a last question. So I leave the child theme active?
    I thought the child theme was only for testing.

    Best regards,
    Oscar

Viewing 30 posts - 1 through 30 (of 33 total)
  • The topic ‘Add Global Google tag in my Enfold’ is closed to new replies.