{"id":8447,"date":"2019-10-17T12:54:42","date_gmt":"2019-10-17T12:54:42","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=8447"},"modified":"2026-03-16T18:22:30","modified_gmt":"2026-03-16T12:52:30","slug":"add-google-analytics-to-wordpress","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/","title":{"rendered":"How to add Google Analytics to WordPress with and without using plugin?"},"content":{"rendered":"<p>This article guides you on how to add Google Analytics to your WordPress in two different ways.<\/p>\n<h2>Why add Google Analytics to WordPress?<\/h2>\n<p>Google Analytics provides you with very detailed statistics about your website and the traffic coming to it. But, to use Google Analytics with a WordPress or any other site, first, you need to sign-up for a Google Analytics account at <a href=\"https:\/\/marketingplatform.google.com\/about\/analytics\/\" target=\"_blank\" rel=\"nofollow noopener\">http:\/\/www.google.com\/analytics<\/a> and get a unique Tracking ID.<\/p>\n<p>Once you set up the Google Analytics account and get the Tracking ID for your site, you can easily configure WordPress to it. You can do this, in two ways :<\/p>\n<p>(i) By using a WordPress plugin.<\/p>\n<p>(ii) By editing the WordPress theme.<\/p>\n<h3>Method 1: Adding Google Analytics to WordPress using plugin :<\/h3>\n<p>There are various plugins available that enable you to configure Google Analytics for a WordPress site, and they all function in one and the same ways. You just need to specify your Tracking ID, and the plugin will work as required.<br \/>\nSome of the popular Google Analytics plugins for WordPress are :<\/p>\n<p><a href=\"https:\/\/wordpress.org\/plugins\/google-analytics-for-wordpress\/\" target=\"_blank\" rel=\"nofollow noopener\">Google Analytics for WordPressGoogle Analyticator<\/a><\/p>\n<p><a href=\"https:\/\/wordpress.org\/plugins\/googleanalytics\/\" target=\"_blank\" rel=\"nofollow noopener\">Google Analytics<\/a><\/p>\n<h3>Method 2: Adding Google Analytics to WordPress by editing the theme :<\/h3>\n<p>Plugins seem to be convenient, but they carry processing overhead with them that may affect the site performance. If you don&#8217;t use a plugin then you can edit the WordPress theme directly to enable Google Analytics.<\/p>\n<p><strong># Perform the following steps to enable Google Analytics by editing the theme :<\/strong><\/p>\n<p>1. Log in to your <strong>Google Analytics<\/strong> account.<\/p>\n<p>2. Click on Admin, again click on Tracking Info, and then click on Tracking Code. Now copy the entire text in the tracking code box, including the <strong>starting &lt;script&gt;\u00a0tag<\/strong>\u00a0and the <strong>ending &lt;\/script&gt; tag<\/strong>.<\/p>\n<p>3. Now, login to <strong>WordPress as an administrator<\/strong>.<\/p>\n<p>4. Under the <strong>Dashboard<\/strong>, click on <strong>Appearance<\/strong>, and then on <strong>Editor<\/strong>. The <strong>Edit Themes<\/strong> page gets appear.<\/p>\n<p>5. Go to <strong>Templates<\/strong> and under it click <strong>Header (header.php)<\/strong>.<\/p>\n<p>6. Identify the <strong>ending &lt;\/head&gt;<\/strong> tag. Just above this &lt;\/head&gt; tag, paste the <strong>Tracking ID<\/strong> code snippet from Google Analytics that you have got from Step 1.<\/p>\n<p>Ensure that you include the<strong> starting &lt;script&gt;\u00a0tag<\/strong> and the <strong>ending &lt;\/script&gt; tag<\/strong>.<\/p>\n<p>7. Click on the <strong>Update File<\/strong>. Google Analytics will now be enabled for all pages on your WordPress site.<\/p>\n<p>It may take up to 24 hours for Google Analytics to change its status from Tracking Not Installed to Receiving Data.<\/p>\n<p><strong>Also Read :<\/strong><\/p>\n<p>1)\u00a0<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/steps-to-disable-wordpress-plugins-without-accessing-the-wp-admin\/\" target=\"_blank\" rel=\"noopener\">Steps to Disable WordPress Plugins Without Accessing the WP \u2013 Admin<\/a><\/p>\n<p>2)\u00a0<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-disable-all-wordpress-plugins-directly-from-the-database\/\" target=\"_blank\" rel=\"noopener\">How to disable all WordPress plugins directly from the database?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article guides you on how to add Google Analytics to your WordPress in two different ways. Why add Google Analytics to WordPress? Google Analytics provides you with very detailed statistics about your website and the traffic coming to it. But, to use Google Analytics with a WordPress or any other site, first, you need [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3081],"tags":[1064,1065,1066],"class_list":["post-8447","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-plugins-and-integrations","tag-google-analytics-and-wordpress","tag-google-analytics-in-wordpress","tag-google-analytics-to-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-17T12:54:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T12:52:30+00:00\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\"},\"author\":{\"name\":\"Sonam Wagh\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"headline\":\"How to add Google Analytics to WordPress with and without using plugin?\",\"datePublished\":\"2019-10-17T12:54:42+00:00\",\"dateModified\":\"2026-03-16T12:52:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\"},\"wordCount\":437,\"commentCount\":0,\"keywords\":[\"Google Analytics and WordPress\",\"Google Analytics in WordPress\",\"Google Analytics to WordPress\"],\"articleSection\":[\"Plugins &amp; Integrations\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\",\"name\":\"How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2019-10-17T12:54:42+00:00\",\"dateModified\":\"2026-03-16T12:52:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add Google Analytics to WordPress with and without using plugin?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb","description":"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb","og_description":"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-10-17T12:54:42+00:00","article_modified_time":"2026-03-16T12:52:30+00:00","author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/"},"author":{"name":"Sonam Wagh","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"headline":"How to add Google Analytics to WordPress with and without using plugin?","datePublished":"2019-10-17T12:54:42+00:00","dateModified":"2026-03-16T12:52:30+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/"},"wordCount":437,"commentCount":0,"keywords":["Google Analytics and WordPress","Google Analytics in WordPress","Google Analytics to WordPress"],"articleSection":["Plugins &amp; Integrations"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/","name":"How to add Google Analytics to WordPress with and without using plugin? - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2019-10-17T12:54:42+00:00","dateModified":"2026-03-16T12:52:30+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"Google Analytics is a must for your WordPress site. Learn how to add Google Analytics to WordPress with and without using plugin.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/add-google-analytics-to-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to add Google Analytics to WordPress with and without using plugin?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sonam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=8447"}],"version-history":[{"count":3,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8447\/revisions"}],"predecessor-version":[{"id":16691,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8447\/revisions\/16691"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=8447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=8447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=8447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}