5

The reason is you are using HostGator and enable the feature is Google Analytics Integration, by enable this one, HostGator will automatically add this snipped of code into your main website and all of it sub or add-on domain: <script src='/google_analytics_auto.js'></script></head> I my self also faced with this issue, my main website is ...


4

Google wants to see that you have ownership of the domain, because on some sites, subscribers have the ability to upload to the media library. You'll need to upload the file using FTP/SFTP to the domain's root folder (i.e. public_html or www). You should be able to get these from your hosting provider. Sometimes they can also upload the file for you.


4

Check header.php and footer.php; sounds like that link is part of your theme and is pulling that script, possibly from a plugin that is supposed to be included with the theme or in the "must use" plugin folder, which is called mu-plugins in wp-content.


3

Take a look at custom variables for Google Analytics. In that case you would need to parse all used tags as one string (maybe separated by | for example), because it's better to use one variable name and each variable can take one value per pageview. Another option would be using events, using a category (named tags for example), which you could repeat for ...


2

For anyone who came to this question here is the correct answer: Use has_shorcode() to detect if a specific shortcode was called. Can be viewed here: https://developer.wordpress.org/reference/functions/has_shortcode/


2

Sure, that's possible. Are you including the GA-code anywhere on your site today? If not, you can add the following code to your theme's functions.php-file: add_action('wp_head', 'add_google_analytics'); function add_google_analytics(){ global $post; if (is_page('page1')){ ?> <!-- Analytics code #1 --> <?php } else if (...


2

Since your question is about installing the google analytics code in Wordpress, I will highly recommend you to install the UA-XXXXXX-X tracking code before the closing head tag "</head>". Just edit the theme header.php file. You don't need to create a child theme unless you are using someone else's theme that could potentialy be updated or ask you ...


2

I would use phpmailer_init (unless you're using a plugin that overrides wp_mail): function trigger_contact_event( $phpmailer ) { // See PHPMailer class for available properties & methods if you need // information about the email being sent. } add_action( 'phpmailer_init', 'trigger_contact_event' );


1

You can use that snippet just anywhere where it can be rendered on single pages. For example, you can paste this under functions.php of your theme: function hook_disqus_config(){ if( ! is_singular() ) return; ?> <script type="text/javascript"> function disqus_config() { this.callbacks.onNewComment = [function(comment) { ...


1

You shouldn't have a call to wp_head hook twice. Why does comments need its own call? Get rid of second call and see if that doesn't break anything.


1

Paste to the closing </body>tag ... Look for the footer.php file in your theme template on your hosting


1

So it means that there were some requests for given url processed by your site. Probably some user have requested it. This request is a search for phrase “free” in category “plus 5 results”


1

Changing any URLs will have an effect on your SEO. So, if you want zero effect on SEO, you cannot also change URLs from example.com/post to example.com/blog/post. You'll want to look at how well-established your site is - if you have hundreds or thousands of posts that are ranking well, you likely should not change URLs at all. However, if you have a newer ...


1

It doesn't change the theme itself. It uses a hook to insert the tracking code. View the source of one of your outputted front-end pages, and you'll see the JS injected in there somewhere.


1

When I disable Content Visibility for Divi Builder then the tag goes away. Seems suspicious... maybe they got hacked or maybe they are bad cookies. Will try to move this to the proper reporting channels. AoD Technologies LLC is the developer. Edit: wanted to temper this with a third possibility of tracking the usage of their plugin Edit 2: the developer ...


1

You have two options. Option 1: use the same tracking code for your main website and your WordPress site. This is probably the easiest solution, and it will give you access to the same goals, user data, etc. all in one convenient location. Option 2: use a different tracking code, so you can more easily track the two separate websites. The biggest downside ...


1

I think you need to do a couple of things: Move your calls to get the user inside your function - PHP variables aren't shared across scopes without using global, which is generally a bad idea because it pollutes the global scope Consolidate your JS Use escaping methods before outputting data With those in mind, I think this might work for you: <?php /**...


1

The easiest way would be to hook onto the login_footer action and output your GA code: <?php add_action( 'login_footer', 'zzMzz_output_ga' ); function zzMzz_output_ga() { ?> <!-- Your Google analytics <script> tag here --> <?php }


1

Haven't seen a plugin that does this, since each theme would differ. But for a custom solution that would work with Google Analytics events see #9 here: https://searchenginewatch.com/sew/how-to/2287906/10-google-analytics-custom-events-that-track-the-untrackable OP also found this more specific article: http://cutroni.com/blog/2014/02/12/advanced-content-...


1

This is not really a WordPress specific question, but since WordPress does not provide customization for menu items, I think you're gonna need this. You can use .bind() in jQuery to add an event to user's click on an specific item. Take a look at this: jQuery(document).ready(function(){ jQuery( "#menu-item-57" ).bind( "click", function() { ...


1

If the HTML files are outside of your wordpress installation, you need to insert the Google Analytics tracking code into each of the HTML pages manually. For the Wordpress pages, you can insert the code into your Theme's header file (usually header.php) or similar or use one of the many plugins to do this.


1

It would appear the issue is a bug created by the plugin developers. They apparently did not test version 2.1 of the plugin on a server running IIS. The string search they perform assumes the directory path of the plugin uses forward slashes /, but on IIS the path uses backslashes \. To resolve this issue, you may replace realpath( __FILE__ ) with ...


1

If you rename the plugins folder googleanalytics into something else, e.g. OLDgoogleanalytics then refresh your website, the error is gone. Now you can access your backend plugins page (optional: rename the folder OLDgoogleanalytics back to googleanalytics) and you can see that trying to enable the Google Analytics plugin gives the error you mentioned. I ...


1

It will be available on all template files (single, page, index, ...) that call that specific footer (if there's only 1 footer.php every call to get_footer will include that file) If footer.php is modified by the original creator then yes this is overwritten. A solution is to create a child theme based on the original theme and modify that instead. Another ...


1

If you have Yoast's Analytics plugin, this wouldn't be super hard. However, it will require some coding knowledge. I won't spell everything out for you, but I will point you in the right direction. Without Yoast, you'll have to review Lots of Documentation Load Yoast GA Files/Classes and Analytics ID from Yoast (or use Google Client API itself) Request Most ...


1

After reading more about the google analytic site, I found that it can take a while for analytics to start working. After waiting a full night, analytics is now working perfectly.


1

I'm not sure if this is legal in all countries but you can send the emailadress back to you by adapting it in the link the user clicks to your website. e.g. The email they receive has a button that links to your website. the url of the button looks like this: <a href="http://www.yourwebsite.com?email='email@receiver.com'"><img src="button.jpg">&...


1

Search code comes with wordpress.If you remove search box it does not mean that search page is removed. If you want that google should not crawl your search page then you can specify in your robot.txt file like below : Disallow: /search


1

Hi Mark Kaplun and toscho, thank you for replying. I've figured out the culprit, it was caused by W3 Total Cache Plugin setting. Under Browser Cache, I have to untick this: Prevent caching of objects after settings change The weird string before every links is then removed.


1

It seems that your Urchin is configured to measure hits on your server instead of page views (this is speculation since I do not have the link to your site). The high number could only be explained by the fact that one pageview would require multiple elements on your site (js files, css files, images, etc). GA and Jetpack always have discrepancies and that ...


Only top voted, non community-wiki answers of a minimum length are eligible