{"id":9046,"date":"2021-12-01T12:12:31","date_gmt":"2021-12-01T11:12:31","guid":{"rendered":"https:\/\/www.myagileprivacy.com\/how-to-install-google-analytics-in-accordance-with-gdpr\/"},"modified":"2026-01-02T15:10:50","modified_gmt":"2026-01-02T14:10:50","slug":"how-to-install-google-analytics-in-accordance-with-gdpr","status":"publish","type":"post","link":"https:\/\/www.myagileprivacy.com\/en\/how-to-install-google-analytics-in-accordance-with-gdpr\/","title":{"rendered":"How to install Google Analytics in accordance with GDPR"},"content":{"rendered":"<p>Google Analytics 4 (GA4) is Google\u2019s next-generation analytics platform, essential for monitoring traffic and conversions on your website. GA4 provides valuable insights into user behavior, helps you measure the performance of your marketing campaigns, and ensures you stay compliant with privacy regulations such as the GDPR.<\/p>\n<p>This tutorial will guide you through installing Google Analytics 4 on your website and configuring it to comply with privacy rules.<\/p>\n<hr \/>\n<h2><strong>Step 1: Create a Google Analytics 4 Property<\/strong><\/h2>\n<p>To begin, make sure you have a Google account and admin access to the website where you want to install analytics.<\/p>\n<ol>\n<li>Log in to <a href=\"https:\/\/analytics.google.com\/\" target=\"_blank\" rel=\"noopener\">Google Analytics<\/a>.<\/li>\n<li>Click on the <strong>Admin<\/strong> (gear icon) in the lower-left sidebar.<\/li>\n<li>In the \u201cAccount\u201d column, select the relevant account or create a new one if needed.<\/li>\n<li>In the \u201cProperty\u201d column, click <strong>Create Property<\/strong> and follow the prompts to set the property name, time zone, and currency.<\/li>\n<li>Complete the setup by answering questions about your business type, then click <strong>Next<\/strong> and <strong>Create<\/strong>.<\/li>\n<\/ol>\n<hr \/>\n<h2><strong>Step 2: Get the GA4 Tracking Code<\/strong><\/h2>\n<p>After setting up the property:<\/p>\n<ol>\n<li>Go to <strong>Data Streams<\/strong> and choose <strong>Web<\/strong>.<\/li>\n<li>Enter your website\u2019s URL and assign a name to the stream.<\/li>\n<li>Click <strong>Create Stream<\/strong>. The tracking code (in the format G-XXXXXXXXXX) will be displayed.<\/li>\n<li>Copy the provided Global Site Tag (gtag.js) code snippet.<\/li>\n<\/ol>\n<hr \/>\n<h2><strong>Step 3: Insert the GA4 Code into Your WordPress Site<\/strong><\/h2>\n<ul>\n<li>You can manually insert the code into your theme\u2019s <code class=\"\" data-line=\"\">header.php<\/code> file (before the closing <code class=\"\" data-line=\"\">&lt;\/head&gt;<\/code> tag), or use a plugin like \u201cInsert Headers and Footers\u201d to add the script safely, without editing theme files directly.<\/li>\n<\/ul>\n<h3><strong>If You\u2019re Using Google Tag Manager:<\/strong><\/h3>\n<ol>\n<li>Create a new Tag of the type \u201cGA4 Configuration.\u201d<\/li>\n<li>Enter your Measurement ID from Google Analytics (G-XXXXXXXXXX format).<\/li>\n<li>Set the trigger to \u201cAll Pages\u201d and publish the tag.<\/li>\n<\/ol>\n<hr \/>\n<h2><strong>Step 4: Ensure GDPR Compliance<\/strong><\/h2>\n<p>Activate the \"Cookie Shield\" feature in My Agile Privacy<sup>\u00ae<\/sup>: this mode can automatically detect cookies and third-party software. Set the Shield to \"Learning\" mode, browse your site\u2019s pages, and your configuration will be ready.<br \/>\n<strong>Tip:<\/strong> Ensure your consent settings are compatible with Google Consent Mode v2.<\/p>\n<hr \/>\n<h2><strong>Step 5: Verify the Installation<\/strong><\/h2>\n<p>Once everything is configured, return to Google Analytics, go to <strong>Real Time<\/strong>, and browse your site in a private (incognito) window. You should see your visit appear.<br \/>\n<em>Note: Sometimes, it takes a few minutes for data to show up in your reports.<\/em><\/p>\n<hr \/>\n<h2><strong>Bonus: Advanced & Server-Side Solutions<\/strong><\/h2>\n<p>If you want optimized performance, maximum privacy compliance, and to avoid blocking from iOS or AdBlockers, solutions like <a href=\"https:\/\/www.myagilepixel.com\/en\/\" target=\"_blank\" rel=\"noopener\">My Agile Pixel<\/a> let you send Google Analytics 4 data server-side, improving data quality and accuracy.<br \/>\nSee <a href=\"https:\/\/www.myagilepixel.com\/come-configurare-google-analytics-4-a-norma-gdpr\/\" target=\"_blank\" rel=\"noopener\">here<\/a> for details on integrating GA4 with My Agile Pixel for a GDPR-compliant, future-proof solution.<\/p>\n<hr \/>\n<p>With these steps, you can install Google Analytics 4 easily, securely, and in full compliance with current regulations\u2014so you can start collecting quality data to help your online project grow!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Analytics 4 (GA4) is Google\u2019s next-generation analytics platform, essential for monitoring traffic and conversions on your website. GA4 provides valuable insights into user behavior, helps you measure the performance of your marketing campaigns, and ensures you stay compliant with privacy regulations such as the GDPR. This tutorial will guide you through installing Google Analytics [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8692,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[33],"tags":[35],"class_list":["post-9046","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cookies","tag-free"],"acf":{"visibilita_box_autore":false,"autore_associato":null,"elenco_faq_articolo":null,"url_esterno":"","titolo":"Google Analytics"},"_links":{"self":[{"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/posts\/9046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/comments?post=9046"}],"version-history":[{"count":13,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/posts\/9046\/revisions"}],"predecessor-version":[{"id":15170,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/posts\/9046\/revisions\/15170"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/media\/8692"}],"wp:attachment":[{"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/media?parent=9046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/categories?post=9046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myagileprivacy.com\/en\/wp-json\/wp\/v2\/tags?post=9046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}