{"id":4248,"date":"2018-01-08T14:26:08","date_gmt":"2018-01-08T20:26:08","guid":{"rendered":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/"},"modified":"2018-01-08T14:26:08","modified_gmt":"2018-01-08T20:26:08","slug":"wordpress-google-analytics-tag-manager","status":"publish","type":"post","link":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/","title":{"rendered":"Google Analytics &amp; Tag Manager for WordPress"},"content":{"rendered":"<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg\" alt=\"Google analytics and Tag Manager\" class=\"wp-image-2509\"><\/figure>\n\n\n\n<p><span style=\"font-weight: 400\">To drive targeted traffic to your website, and to keep the traffic you currently have, it\u2019s important that your site caters to your audience\u2019s needs. However, understanding exactly what your audience needs can be difficult without the right <\/span><span style=\"font-weight: 400\">tracking info<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Fortunately, <\/span><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/analytics.google.com\/analytics\/web\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Google Analytics<\/span><\/a><span style=\"font-weight: 400\"> is a tool that enables you to collect user data and use it to your (and your <\/span><span style=\"font-weight: 400\">visitors\u2019<\/span> <span style=\"font-weight: 400\">advantage). By implementing what you learn on your website, you can then improve user engagement and boost traffic.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">In this post, we\u2019ll introduce you to<\/span> <span style=\"font-weight: 400\">installing <\/span><span style=\"font-weight: 400\">Google Analytics<\/span> <span style=\"font-weight: 400\">on <\/span><span style=\"font-weight: 400\">WordPress <\/span><span style=\"font-weight: 400\">manually<\/span><span style=\"font-weight: 400\">. This will include a look at how to <\/span><span style=\"font-weight: 400\">integrate Google Analytics<\/span> <span style=\"font-weight: 400\">on your website with and without <\/span><span style=\"font-weight: 400\">any <\/span><span style=\"font-weight: 400\">WordPress plugin<\/span><span style=\"font-weight: 400\">. You\u2019ll also learn how Google Analytics and <\/span><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.google.com\/analytics\/tag-manager\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Tag Manager<\/span><\/a><span style=\"font-weight: 400\"> work effortlessly together, and how to install both on your site.<\/span><\/p>\n\n\n\n<h2 id=\"toc-google-analytics-for-wordpress\" class=\"wp-block-heading\">Google Analytics for WordPress<\/h2>\n\n\n\n<p><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/analytics.google.com\/analytics\/web\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Google Analytics<\/span><\/a><span style=\"font-weight: 400\"> is a web analytics service that launched in 2005. When connected to your website, it can collect user data including demographics and behavior, so you can better understand (and cater to) your <\/span><span style=\"font-weight: 400\">website <\/span><span style=\"font-weight: 400\">visitors<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n<p><span style=\"font-weight: 400\">Fortunately, Google Analytics and WordPress work seamlessly together. This means you can collect all the data you need, then optimize your WordPress site based on <\/span><span style=\"font-weight: 400\">your G<\/span><span style=\"font-weight: 400\">oogle Analytics report<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n\n\n\n<h3 id=\"toc-how-to-add-google-analytics-to-wordpress\" class=\"wp-block-heading\">How to Add Google Analytics to WordPress<\/h3>\n\n\n\n<p>Within WordPress, there are two main ways to add Google Analytics to your WordPress website. One is with the use of a WordPress plugin, and the other is without. Let\u2019s take a closer look at both options.<\/p>\n\n\n\n<h3 id=\"toc-how-to-add-google-analytics-with-wordpress-plugins\" class=\"wp-block-heading\">How to Add Google Analytics with WordPress Plugins<\/h3>\n\n\n\n<p>One of the easiest ways to add Google Analytics to WordPress is with plugins. This is a great option for those who only need a \u2018basic\u2019 installation, or who aren\u2019t technologically savvy.<\/p>\n\n\n\n<h4 id=\"toc-google-analytics-wordpress-plugins\" class=\"wp-block-heading\">Google Analytics WordPress Plugins<\/h4>\n\n\n\n<p>The first plugin\u2014and one of the most popular\u2014is <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpress.org\/plugins\/google-analytics-for-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Analytics for WordPress<\/a> by MonsterInsights. While this plugin has <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.monsterinsights.com\/how-to-properly-setup-google-analytics-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">a potentially lengthy setup process<\/a>, there\u2019s no need to edit your WordPress Google Analytics code. As such, it\u2019s a great option for beginners:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag2.jpg\" alt=\"Google analytics for WordPress plugin\" class=\"wp-image-2510\"><\/figure>\n\n\n\n<p><span style=\"font-weight: 400\">Another popular plugin choice is <\/span><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/wordpress.org\/plugins\/google-analytics-dashboard-for-wp\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">Google Analytics Dashboard for WP (GADWP)<\/span><\/a><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">The Go<\/span><span style=\"font-weight: 400\">ogle Analytics Dashboard plugin<\/span> <span style=\"font-weight: 400\">makes it <\/span><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/deconf.com\/google-analytics-dashboard-wordpress\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">simple to install Google Analytics<\/span><\/a><span style=\"font-weight: 400\"> on each page of your website (with the plugin\u2019s <\/span><span style=\"font-weight: 400\">tracking <\/span><span style=\"font-weight: 400\">info<\/span> <span style=\"font-weight: 400\">component), and will also help you to read the collected data:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag3.jpg\" alt=\"Google Analytics Dashboard for WordPress plugin\" class=\"wp-image-2511\"><\/figure>\n\n\n\n<p>While there may be easier options, they aren\u2019t always the best. Let\u2019s look at another way to add Google Analytics to your WordPress website.<\/p>\n\n\n\n<h3 id=\"toc-how-to-add-google-analytics-without-wordpress-plugins\" class=\"wp-block-heading\">How to Add Google Analytics without WordPress Plugins<\/h3>\n\n\n\n<p>The other way to add Google Analytics to your website is through <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.monsterinsights.com\/how-to-add-google-analytics-to-wordpress-without-a-plugin\/\" target=\"_blank\" rel=\"noreferrer noopener\">adding Google Analytics\u2019 tracking code manually<\/a>. The simplest way is to add it via the dashboard\u2019s <em>Appearance<\/em> &gt; <em>Editor<\/em> screen. This requires some HTML knowledge, but it\u2019s not difficult.<\/p>\n\n\n\n<h4 id=\"toc-where-to-put-google-analytics-tracking-code-in-wordpress\" class=\"wp-block-heading\">Where to Put Google Analytics Tracking Code in WordPress<\/h4>\n\n\n\n<p>Simply put, the tracking code can be placed just about anywhere on your website, including the head, body, and footer. However, there are some pros and cons to each option.<\/p>\n\n\n\n<p>If you place your tracking code at the very top of the HTML &lt;<em>head<\/em>&gt; section, the code will be executed almost immediately as the user lands on the page. This is where <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\" target=\"_blank\" rel=\"noopener noreferrer\">Google<\/a> recommends placing the code:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag4.jpg\" alt=\"add google analytics to wordpress without plugins\" class=\"wp-image-2512\"><\/figure>\n\n\n\n<p>Alternatively, placing the code at the end of your HTML will mean it\u2019s executed after all other code on the page. If a user leaves your website (or page) before the code has been executed, no data will be collected:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag5.jpg\" alt=\"steps to add google analytics to wordpress\" class=\"wp-image-2513\"><\/figure>\n\n\n\n<p>As you might imagine, placing the tracking code in the &lt;<em>body<\/em>&gt; section will mean the code could be executed at any point during the page load. You won\u2019t collect the data of users who bounce quickly from the page, but you\u2019ll collect more than if it was at the end of the HTML:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag6.jpg\" alt=\"how to add google analytics to wordpress\" class=\"wp-image-2514\"><\/figure>\n\n\n\n<p>There is no right or wrong place for the code, so the decision is yours. Consider exactly what you\u2019d like to track, then place the tracking code accordingly.<\/p>\n\n\n\n<h2 id=\"toc-google-tag-manager-for-wordpress\" class=\"wp-block-heading\">Google Tag Manager for WordPress<\/h2>\n\n\n\n<p>In simplest terms, <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.google.com\/analytics\/tag-manager\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Tag Manager<\/a> is a system that manages JavaScript and HTML codes used for tracking and analytics. When used with WordPress, you can very easily add Google Analytics (and other Google products) to your website.<\/p>\n\n\n\n<p>Perhaps best of all, Google Tag Manager is a scalable solution for all websites, especially enterprise-level sites. This means it\u2019ll continue to work for you, even as your site grows.<\/p>\n\n\n\n<h3 id=\"toc-how-to-install-google-tag-manager-for-wordpress\" class=\"wp-block-heading\">How to Install Google Tag Manager for WordPress<\/h3>\n\n\n\n<p>Installing Google Tag Manager in WordPress is a simple three-step process. To begin, head over to the <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/www.google.com\/analytics\/tag-manager\/\" target=\"_blank\" rel=\"noreferrer noopener\">Tag Manager home page<\/a> and sign up (or sign in with your current Google Analytics account):<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag7.jpg\" alt=\"install google tag manager for wordpress\" class=\"wp-image-2515\"><\/figure>\n\n\n\n<p><span style=\"font-weight: 400\">Here, you\u2019ll be asked to name your <\/span><span style=\"font-weight: 400\">Google <\/span><span style=\"font-weight: 400\">account <\/span><span style=\"font-weight: 400\">(we recommend using your company name) and your <em>Container<\/em>. In this case, your <\/span><a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/resources\/http-vs-www-urls-for-seo\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400\">website\u2019s URL<\/span><\/a><span style=\"font-weight: 400\">:<\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag8.jpg\" alt=\"how to add google tag manager to wordpress\" class=\"wp-image-2516\"><\/figure>\n\n\n\n<p>Once you\u2019ve set up your account, you\u2019ll be given two separate codes:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag9.jpg\" alt=\"install google tag manager onto wordpress\" class=\"wp-image-2517\"><\/figure>\n\n\n\n<p>Copy the first code, and head to your WordPress dashboard. Go to <em>Appearance<\/em> &gt; <em>Editor,<\/em> and you\u2019ll see a list of different files on the right side. Select <em>theme<\/em> <em>header.php<\/em>. Find the &lt;<em>head<\/em>&gt; element within the file, and paste the first part of the Tag Manager code directly below it:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag10.jpg\" alt=\"google tag manager for wordpress\" class=\"wp-image-2518\"><\/figure>\n\n\n\n<p>Go back to Tag Manager, and copy the second (i.e. bottom) code. Once again return to your website, and paste this code right after the opening &lt;<em>body<\/em>&gt; element:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag11.jpg\" alt=\"steps to install google tag manager for wordpress\" class=\"wp-image-2519\"><\/figure>\n\n\n\n<p>Click <em>Update File<\/em> and you should see a confirmation appear. That\u2019s it\u2014you\u2019ve successfully added Tag Manager to your WordPress site!<\/p>\n\n\n\n<h3 id=\"toc-how-to-install-google-analytics-through-google-tag-manager\" class=\"wp-block-heading\">How to Install Google Analytics Through Google Tag Manager<\/h3>\n\n\n\n<p><span style=\"font-weight: 400\">Once Google Tag Manager is successfully installed, it\u2019s time to install and use Google Analytics. When completed, Google Analytics will \u201cfunnel\u201d through Google Tag Manager on your website.<\/span><\/p>\n\n\n\n<p>In fact, once it\u2019s set up, you don\u2019t even have to add analytics code to your site. To begin, go back to your Tag Manager account and click <em>New Tag<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag12.jpg\" alt=\"Install google analytics through tag manager\" class=\"wp-image-2520\"><\/figure>\n\n\n\n<p>You\u2019ll now have two separate boxes: <em>Tag Configuration and Triggering<\/em>. Click <em>Tag type<\/em> in the <em>Tag Configuration<\/em> box and select <em>Universal Analytics<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag13.jpg\" alt=\"how to install google analytics on wordpress with tag manager\" class=\"wp-image-2521\"><\/figure>\n\n\n\n<p>You\u2019ll also need to configure the <em>Google Analytics Settings<\/em>. You can do this independently, or <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/support.google.com\/tagmanager\/answer\/6107124#override\" target=\"_blank\" rel=\"noreferrer noopener\">set an override option<\/a>. Both of these require your Analytics <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"outbound\" href=\"https:\/\/support.google.com\/analytics\/answer\/1008080?visit_id=1-636487845075132391-1387959027&amp;rd=1\" target=\"_blank\" rel=\"noreferrer noopener\">Tracking ID<\/a>. <span style=\"font-weight: 400\">Once your Google Analytics tracking ID is configured, move on to <em>Triggering<\/em> . For <em>Page View<\/em>, you\u2019ll want to select <em>All Pages.<\/em><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag14.jpg\" alt=\"Use tag manager to install google analytics on wordpress\" class=\"wp-image-2522\"><\/figure>\n\n\n\n<p>This very last step is crucial, because otherwise the tag will not be published. On the Tag Manager account page, click <em>SUBMIT<\/em> in the top right corner. Add a <em>Version Name<\/em> and <em>Description<\/em>, and then be sure your new GA tag is showing under <em>Workspace Changes<\/em>. Once you\u2019ve verified, click <em>PUBLISH<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag15.jpg\" alt=\"add google analytics to wordpress with tag manager\" class=\"wp-image-2523\"><\/figure>\n\n\n\n<p>With your Google Analytics tag now configured and published, Google Tag Manager will implement the tag on your website. In no time at all, your Google Analytics account will begin to collect user data, which you can then use to optimize your website for your audience.<\/p>\n\n\n\n<p>To optimize your website even further, consider <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/managed-wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP Engine\u2019s managed hosting plans for WordPress<\/a>. With quality <a data-analytics-action-type=\"link\" data-analytics-link-location=\"Post Content\" data-analytics-link-type=\"internal\" href=\"https:\/\/wpengine.com\/wordpress-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">WordPress hosting<\/a>, you can be sure your website is always running as smoothly as possible. Get started today!<\/p>","protected":false},"excerpt":{"rendered":"<p>To drive targeted traffic to your website, and to keep the traffic you currently have, it\u2019s important that your site caters to your audience\u2019s needs. However, understanding exactly what your audience needs can be difficult without the right tracking info. Fortunately, Google Analytics is a tool that enables you to collect user data and use [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"mediapress_draft_name":"","_mediapress_is_draft_copy":false,"_time_to_read":6,"footnotes":""},"audience":[],"blog-category":[121],"buyer-stage":[],"company-and-culture":[],"content-type":[54],"location":[],"persona":[106],"product":[],"topic":[100],"use-cases":[],"class_list":["post-4248","post","type-post","status-publish","format-standard","hentry","blog-category-best-practices","content-type-blog","persona-developer","topic-wordpress"],"acf":{"hero_image_alt_text":"","featured_on_hub_page":false,"featured_on_tag_page":false,"featured_on_category_page":false,"wp_engine_pick":false,"display_author_bio":false,"taxonomy_selector":{"":null,"taxonomy-audience":false,"taxonomy-buyer-stage":false,"taxonomy-company-and-culture":false,"taxonomy-content-type":[54],"taxonomy-location":false,"taxonomy-persona":[106],"taxonomy-product":false,"taxonomy-topic":[100],"taxonomy-use-cases":false}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Analytics &amp; Tag Manager for WordPress | WP Engine\u00ae<\/title>\n<meta name=\"description\" content=\"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Analytics &amp; Tag Manager for WordPress | WP Engine\u00ae\" \/>\n<meta property=\"og:description\" content=\"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\u00ae\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-01-08T20:26:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1\" \/>\n\t<meta property=\"og:image:height\" content=\"1\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sam Rodriguez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpengine\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sam Rodriguez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/\"},\"author\":{\"name\":\"Sam Rodriguez\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/9625524bbe6079f6f8795d393dc2c22f\"},\"headline\":\"Google Analytics &amp; Tag Manager for WordPress\",\"datePublished\":\"2018-01-08T20:26:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/\"},\"wordCount\":1215,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/GAandTag.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/\",\"name\":\"Google Analytics & Tag Manager for WordPress | WP Engine\u00ae\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/GAandTag.jpg\",\"datePublished\":\"2018-01-08T20:26:08+00:00\",\"description\":\"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/GAandTag.jpg\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2017\\\/12\\\/GAandTag.jpg\",\"caption\":\"Google analytics and Tag Manager\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/wordpress-google-analytics-tag-manager\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Analytics &amp; Tag Manager for WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"name\":\"WP Engine\u00ae\",\"description\":\"Managed Hosting for WordPress\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/WPEngine_OGImage-1.webp\",\"width\":1200,\"height\":630,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/wpengine\\\/\",\"https:\\\/\\\/x.com\\\/wpengine\",\"https:\\\/\\\/www.instagram.com\\\/wpengine\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/wpengine\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCJeAEAxX69v24CUBZ0WBYSg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/#\\\/schema\\\/person\\\/9625524bbe6079f6f8795d393dc2c22f\",\"name\":\"Sam Rodriguez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g\",\"caption\":\"Sam Rodriguez\"},\"url\":\"https:\\\/\\\/wpengine.com\\\/blog\\\/author\\\/sam-rodriguez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Analytics & Tag Manager for WordPress | WP Engine\u00ae","description":"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!","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:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/","og_locale":"en_US","og_type":"article","og_title":"Google Analytics & Tag Manager for WordPress | WP Engine\u00ae","og_description":"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!","og_url":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/","og_site_name":"WP Engine\u00ae","article_publisher":"https:\/\/www.facebook.com\/wpengine\/","article_published_time":"2018-01-08T20:26:08+00:00","og_image":[{"url":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg","width":1,"height":1,"type":"image\/jpeg"}],"author":"Sam Rodriguez","twitter_card":"summary_large_image","twitter_creator":"@wpengine","twitter_site":"@wpengine","twitter_misc":{"Written by":"Sam Rodriguez","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/"},"author":{"name":"Sam Rodriguez","@id":"https:\/\/wpengine.com\/#\/schema\/person\/9625524bbe6079f6f8795d393dc2c22f"},"headline":"Google Analytics &amp; Tag Manager for WordPress","datePublished":"2018-01-08T20:26:08+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/"},"wordCount":1215,"publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/","url":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/","name":"Google Analytics & Tag Manager for WordPress | WP Engine\u00ae","isPartOf":{"@id":"https:\/\/wpengine.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg","datePublished":"2018-01-08T20:26:08+00:00","description":"Learn how to install Google Analytics tracking code on your WordPress site, including how to easily do it with Google Tag Manager and plugins!","breadcrumb":{"@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#primaryimage","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2017\/12\/GAandTag.jpg","caption":"Google analytics and Tag Manager"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/blog\/wordpress-google-analytics-tag-manager\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/"},{"@type":"ListItem","position":2,"name":"Google Analytics &amp; Tag Manager for WordPress"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/#website","url":"https:\/\/wpengine.com\/","name":"WP Engine\u00ae","description":"Managed Hosting for WordPress","publisher":{"@id":"https:\/\/wpengine.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","contentUrl":"https:\/\/wpengine.com\/wp-content\/uploads\/2025\/09\/WPEngine_OGImage-1.webp","width":1200,"height":630,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/wpengine\/","https:\/\/x.com\/wpengine","https:\/\/www.instagram.com\/wpengine\/","https:\/\/www.linkedin.com\/company\/wpengine\/","https:\/\/www.youtube.com\/channel\/UCJeAEAxX69v24CUBZ0WBYSg"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/#\/schema\/person\/9625524bbe6079f6f8795d393dc2c22f","name":"Sam Rodriguez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/933722cf8761e0c08fbced6085998032df460c5ecfa2481d9cd16f569f3da2c1?s=96&d=mm&r=g","caption":"Sam Rodriguez"},"url":"https:\/\/wpengine.com\/blog\/author\/sam-rodriguez\/"}]}},"mediapress_workflow_parent_id":null,"_links":{"self":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/comments?post=4248"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/posts\/4248\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/media?parent=4248"}],"wp:term":[{"taxonomy":"audience","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/audience?post=4248"},{"taxonomy":"blog-category","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/blog-category?post=4248"},{"taxonomy":"buyer-stage","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/buyer-stage?post=4248"},{"taxonomy":"company-and-culture","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/company-and-culture?post=4248"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/content-type?post=4248"},{"taxonomy":"location","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/location?post=4248"},{"taxonomy":"persona","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/persona?post=4248"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/product?post=4248"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/topic?post=4248"},{"taxonomy":"use-cases","embeddable":true,"href":"https:\/\/wpengine.com\/wp-json\/wp\/v2\/use-cases?post=4248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}