Multiple Google Analytics for Multiple pagepath

You hook into the wp_footer and add your GA code. Here’s is how I would do it. Option 1: Get the current URL and counter check it with you selected URLs. add_action(‘wp_footer’, ‘wpse388915_custom_ga_code’, 99); function wpse388915_custom_ga_code() { $current_url = (is_ssl() ? ‘https://’ : ‘http://’) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]; switch($current_url) { case ‘www.example.com/page/path1’: case ‘www.example.com/page/path2’: case … Read more

Multiple Google Analytics codes for individual pages

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 (is_page(‘page2’)) { ?> <!– Analytics code #2 –> <?php } else { … Read more

Installing google analytics code on wordpress blog

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 … Read more

Does wordpress insert automatic google analytic?

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=”https://wordpress.stackexchange.com/google_analytics_auto.js”></script></head> I my self also faced with this issue, my main website is http://nguyenhuutrong.com and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)