Hey Tim, the plugin likely injects the tracking code into the header section on the page via a function. It does not write it into the header file, otherwise it would get lost when you switch themes or someone could accidentally delete it. If you want to find it on you site, open your homepage, then open the browser developer tools and search for “google” in the HTML inspector. You should then find the script belonging to Google Analytics.
]]>Awesome, your functions.php method worked! Kudos!
]]>Don’t worry about the URL or version, they’re just comments in the code to help you keep track of things – they don’t affect the code in any way. 10 is the level of priority for the function, meaning when it should be executed. 10 is the default value, so just leave it as it is.
]]>You should only ever use one method at a time to connect your website to Google Analytics. Adding more than one tracking code will distort your data. That’s probably the reason why your bounce rate is lower when you use both kinds of implementation. So, you should definitely remove one of them.
]]>Sounds like you did a great job! Happy to be of service!
]]>Keep up the great work.
]]>Sounds like you are trying to upload the files as they are. You need to turn them into a zip file to upload them. To upload to wp-content/plugins, you need to log into your server via FTP.
]]>I’m running into this same issue. I’m trying to upload through the wordpress user interface. (…/wp-admin/plugin-install.php)
This upload option is restricted to .zip files.
How do I upload to wp-content/plugins?
]]>Nadia: Go to Appearance->Theme Editor, and look through the section on the right side that says “Theme Files”. Most themes have a file called header.php, although it’s not a guarantee. [Note: If right under “Theme Files” it says, “This child theme inherits…”, it means you are already using a child theme, so if you don’t see header.php in the list, select the parent theme and look again.]
As Nick said, if you are not already using a child theme, you should do so before editing theme files, so that you won’t lose your customizations. You can even use a plugin to set up the child theme for you (and delete it when you’re done – you don’t have to keep it running) – I know how to make a child theme manually, but I use the “Child Theme Configurator” plugin to save time. Once you have a child theme, copy header.php from the parent to the child and add the Google code.
]]>Hey Nadia, you find the file in your theme directory (wp-content/themes). If you make changes to it, be sure to create a child theme, otherwise you will lose your modifications to your next theme update. Alternatively, you could also use a plugin that allows you to include scripts in your header or footer from the WordPress back end, such as https://wordpress.org/plugins/header-and-footer-scripts/.
]]>Thank you for sharing this valuable content! I really appreciate it!
Only i got lost in the beginning…where do I find the ¨ header.php file¨ ?
Regards,
Nadia
]]>Hey Dimitri, this is a somewhat complex topic and you can find help for it here: https://www.directom.com/google-analytics-subdomain-tracking/
]]>