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