{"id":52711,"date":"2024-08-06T13:46:12","date_gmt":"2024-08-06T08:46:12","guid":{"rendered":"https:\/\/devrims.com\/?p=52711"},"modified":"2025-04-04T17:07:06","modified_gmt":"2025-04-04T12:07:06","slug":"google-analytics-4-php","status":"publish","type":"post","link":"https:\/\/devrims.com\/blog\/google-analytics-4-php\/","title":{"rendered":"How to integrate PHP with GA4 using Google Tag Manager?"},"content":{"rendered":"\r\n\r\n\r\n\r\n\r\n\r\n\n<p>In today&#8217;s data-driven world, understanding user behavior and making informed decisions is essential for the success of any online journey. That&#8217;s where Google Analytics 4 (GA4) steps in, providing valuable insights into website performance and user interactions. If you are a PHP developer seeking to tackle the full potential of GA4, you have come to the right place.<\/p>\n\n\n\n<p>This comprehensive guide will explore the seamless integration of PHP with GA4 using the powerful Google Tag Manager. By leveraging this combination, you can track and analyze user behavior, optimize your website&#8217;s performance, and make data-driven decisions to empower your online success.<\/p>\n\n\n\n<p>Why should you care about integrating PHP with GA4 using Google Tag Manager? The answer lies in the all-important insights you will find. With GA4, you will discover user engagement patterns, identify popular content, track conversions, and more. By integrating PHP, a versatile and widely used scripting language, you will have the flexibility to customize your tracking implementation, capture dynamic data, and maximize the potential of GA4.<\/p>\n\n\n\n<p>This guide will take you on a step-by-step journey, from setting up a Google Tag Manager account to implementing the necessary code snippets in your PHP templates. You will learn it all.<\/p>\n\n\n\n<p>You don&#8217;t need to be a technical wizard or a data scientist to follow along \u2013 we have designed this guide to be beginner-friendly while still providing valuable insights for experienced developers.<\/p>\n\n\n\n<p>So, whether you are an e-commerce entrepreneur, a website owner, or a PHP enthusiast eager to unlock the power of data-driven decision-making, let&#8217;s dive into the world of integrating PHP with GA4 using Google Tag Manager.<\/p>\n\n\n\n<h2 id='integrate-php-with-ga4-using-google-tag-manager-step-by-step'  id=\"boomdevs_1\" class=\"wp-block-heading\">Integrate PHP with GA4 using Google Tag Manager (Step by Step)<\/h2>\n\n\n\n<p>Follow these steps to integrate PHP with GA4 using Google Tag Manager.<\/p>\n\n\n\n<h3 id='setup-a-google-tag-manager-account-and-container'  id=\"boomdevs_2\" class=\"wp-block-heading\">Setup a Google Tag Manager Account and Container<\/h3>\n\n\n\n<p>To set up a <a href=\"https:\/\/tagmanager.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Tag Manager<\/a> Account and Container, go to the Google Tag Manager.<\/p>\n\n\n\n<p>If you are logged in with your Google ID, it will show you an interface like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon.webp\" alt=\"Google Tag Manager\" class=\"wp-image-69159\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/1_1_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, click the &#8220;<strong>Create Account<\/strong>&#8221; button or &#8220;<strong>Click here to create an account<\/strong>&#8221; button to create a new account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon.webp\" alt=\"Create GMT Account\" class=\"wp-image-69160\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon-768x353.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/2_2_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Set up your account by entering your name and selecting the country where your business is located.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"326\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon.webp\" alt=\"GTM - Account Setup\" class=\"wp-image-69161\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon-300x96.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon-768x245.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon-24x8.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon-36x11.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/3_3_11zon-48x15.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Complete the Container Setup by entering your website&#8217;s URL and selecting the Web. Once you add all the details of Account Setup and Container Setup, the &#8220;<strong>Create<\/strong>&#8221; button will be enabled. Click on the &#8220;<strong>Create<\/strong>&#8221; button to proceed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon.webp\" alt=\"GMT - Container Setup\" class=\"wp-image-69162\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon-300x160.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon-768x410.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon-24x13.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon-36x19.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/4_4_11zon-48x26.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>An agreement will appear when you click the &#8220;<strong>Create<\/strong>&#8221; Button. You must read all terms and conditions, accept them, and click the &#8220;<strong>Yes<\/strong>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"552\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon.webp\" alt=\"Google Tag Manager - Terms of Service Agreement\" class=\"wp-image-69163\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon-300x162.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon-768x414.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon-24x13.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon-36x19.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/5_5_11zon-48x26.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Here you go; you have successfully created a new Google Tag Manager Account and Container. You can access the dashboard now.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"458\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon.webp\" alt=\"Google Tag Manager - Workspace Panel or Dashboard\" class=\"wp-image-69164\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon-300x134.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon-768x344.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/6_6_11zon-48x21.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 id='install-the-google-tag-manager-container-code'  id=\"boomdevs_3\" class=\"wp-block-heading\">Install the Google Tag Manager Container Code<\/h3>\n\n\n\n<p>To install the Google Tag Manager Container Code, go to the Google Tag Manager Container dashboard and navigate to the Admin tab.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"468\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon.webp\" alt=\"GTM Admin\" class=\"wp-image-69165\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon-768x351.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/7_7_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You will see a list of options on the right side. Select the &#8220;<strong>Install Google Tag Manager<\/strong>&#8221; option.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"473\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon.webp\" alt=\"Install Google Tag Manager\" class=\"wp-image-69166\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon-768x355.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/8_8_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You will see two sets of code provided here, one for the &lt;head&gt; section and another for the &lt;body&gt; section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon.webp\" alt=\"Installation Instructions\" class=\"wp-image-69167\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon-300x160.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon-768x409.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon-24x13.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon-36x19.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/9_9_11zon-48x26.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Copy the container code for the &lt;head&gt; section. It should look similar to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!-- Google Tag Manager --&gt;\n(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&amp;amp;l='+l:'';j.async=true;j.src=\n'https:\/\/www.googletagmanager.com\/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','GTM-MTL5JFC');\n&lt;!-- End Google Tag Manager --&gt;<\/pre>\n\n\n\n<p>Paste the code into the &lt;head&gt; section of your website&#8217;s HTML or PHP template file just before the closing &lt;\/head&gt; tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"435\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon.webp\" alt=\"Add Script\" class=\"wp-image-69168\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon-300x127.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon-768x326.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon-24x10.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon-36x15.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/10_10_11zon-48x20.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Save the changes to your website&#8217;s file and publish your changes in Google Tag Manager to make the container code live on your website.<\/p>\n\n\n\n<p>Once you are done making changes, go to your website and inspect the search to ensure Google Tag Manager is installed successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon.webp\" alt=\"Verify Google Tag Manager \" class=\"wp-image-69169\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon-300x141.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon-768x362.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/11_11_11zon-48x23.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once the Google Tag Manager Container code is installed, it will work and provide the foundation for managing and deploying tags, including integrating GA4 and other tracking tools. Remember to test the implementation to ensure the container code functions correctly and captures the desired data.<\/p>\n\n\n\n<h3 id='setup-a-ga4-property-and-get-the-measurement-id'  id=\"boomdevs_4\" class=\"wp-block-heading\">Setup a GA4 Property and Get the Measurement ID<\/h3>\n\n\n\n<p>Go to Google Analytics (<a href=\"https:\/\/analytics.google.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">analytics.google.com<\/a>) and sign in with your Google Account.<\/p>\n\n\n\n<p>Once signed in, click on the &#8220;<strong>Admin<\/strong>&#8221; option in the lower-left corner of the screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon.webp\" alt=\"Google Analytics 4 Setup\" class=\"wp-image-69170\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon-768x354.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/12_12_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the &#8220;<strong>Property<\/strong>&#8221; column, click on the &#8220;<strong>Create Property<\/strong>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"476\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon.webp\" alt=\"Create Property - GA4\" class=\"wp-image-69171\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon-768x357.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/13_13_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Enter all the required details, like property name, select time zone, and currency, then click the &#8220;<strong>Next<\/strong>&#8221; button at the bottom.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon.webp\" alt=\"Property Details\" class=\"wp-image-69172\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon-768x353.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/14_14_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Then, select your industry type, describe your business size, and click the &#8220;<strong>Next<\/strong>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"469\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon.webp\" alt=\"Business Details\" class=\"wp-image-69173\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon-768x352.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/15_15_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, select the options or activities you want to examine on your website or your business objectives. After selecting your options, click the &#8220;<strong>Create<\/strong>&#8221; button at the bottom.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"468\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon.webp\" alt=\"Business Objectives\" class=\"wp-image-69174\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon-768x351.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/16_16_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Choose a platform for whom you want to collect the data. In our case, it&#8217;s &#8220;<strong>Web<\/strong>.&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"451\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon.webp\" alt=\"Data Collecting Platform\" class=\"wp-image-69175\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon-300x132.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon-768x338.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/17_17_11zon-48x21.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>As you choose a platform, it will pop up a new window in which you need to set up your web stream. To set up a web stream, you must enter values in the required fields: your website&#8217;s URL and Stream name. Once you are done filling in the fields, click on the &#8220;<strong>Create stream<\/strong>&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon.webp\" alt=\"Create Stream\" class=\"wp-image-69176\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon-300x141.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon-768x360.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/18_18_11zon-48x23.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>When you are done creating a stream, a new window will pop up where you can see the stream details with Measurement ID.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon.webp\" alt=\"Web Stream Details\" class=\"wp-image-69177\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon-300x140.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon-768x359.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/19_19_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That means the property has been created successfully. Close this window, and you will see the property.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"474\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon.webp\" alt=\"Collect Data\" class=\"wp-image-69178\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/20_20_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To get the measurement ID, click on the stream, and you will see stream details there with the measurement ID, as we saw above. Copy that ID, and you can use it anywhere; we will use it further.<\/p>\n\n\n\n<h3 id='create-a-new-google-tag-manager-tag'  id=\"boomdevs_5\" class=\"wp-block-heading\">Create a new Google Tag Manager tag<\/h3>\n\n\n\n<p>To create a new tag, go to Google Tag Manager. On the dashboard, select the container you created earlier. You will see a menu on the left. Navigate to the &#8220;<strong>Tags<\/strong>&#8221; section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"473\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon.webp\" alt=\"Collect Data\" class=\"wp-image-69179\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon-768x355.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/21_21_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click on the \u201cNew\u201d button to create a new tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon.webp\" alt=\"Add New Tag\" class=\"wp-image-69180\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon-768x350.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/22_22_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Or click on the &#8220;<strong>Add a new tag<\/strong>&#8221; card to create a new tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon.webp\" alt=\"Add a New Tag\" class=\"wp-image-69181\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon-768x350.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/23_23_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It will pop a new window in which a few things will be asked to be fulfilled.<\/p>\n\n\n\n<p>First, give a name to the tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"552\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon.webp\" alt=\"Tag Name\" class=\"wp-image-69182\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon-300x162.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon-768x414.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon-24x13.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon-36x19.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/24_24_11zon-48x26.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Then, click on the \u201c<strong>Tag Configuration<\/strong>\u201d box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"468\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon.webp\" alt=\"Tag Configuration\" class=\"wp-image-69183\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon-768x351.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/25_25_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, from the &#8220;<strong>Choose tag type<\/strong>&#8221; section, choose the tag type you want to create. Search for &#8220;<strong>Google Analytics: GA4 Event<\/strong>&#8221; or &#8220;<strong>Google Analytics: GA4 Configuration,<\/strong>&#8221; depending on the type of tag you want to create. Select the appropriate option from the dropdown. I am selecting the &#8220;<strong>Google Analytics: GA4 Configuration<\/strong>&#8221; type here.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon.webp\" alt=\"Google Analytics: GA4 Configuration\" class=\"wp-image-69184\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/26_26_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Configure the settings of the tag based on your requirements. This includes providing the GA4 Measurement ID, setting up event tracking parameters, enabling enhanced measurement, and more. The specific configuration options will vary depending on the type of tag you selected.<\/p>\n\n\n\n<p>Add the measurement ID of your GA4 property that we created earlier. Also, add the values you want to track or require.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"463\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon.webp\" alt=\"GA4 Tag\" class=\"wp-image-69185\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon-300x136.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon-768x347.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/27_27_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After configuring the tag, you can set up triggering conditions under the &#8220;<strong>Triggering<\/strong>&#8221; section. This determines when the tag should fire.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon.webp\" alt=\"Triggering\" class=\"wp-image-69186\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon-768x353.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/28_28_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can choose from pre-built triggers or create custom triggers based on specific user interactions or page conditions by clicking on the \u201c<strong>+<\/strong>\u201d sign.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon.webp\" alt=\"Choose a Trigger\" class=\"wp-image-69187\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon-768x354.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/29_29_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you have configured the tag and its triggering conditions, click on the &#8220;<strong>Save<\/strong>&#8221; button at the top-right corner of the screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon.webp\" alt=\"Save Configuration and Firing Triggers\" class=\"wp-image-69188\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon-768x354.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/30_30_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Congratulations! You have successfully created a new tag in Google Tag Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon.webp\" alt=\"Google Tag Manger is Configured\" class=\"wp-image-69189\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon-300x136.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon-768x349.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/31_31_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The next step is to save and publish your changes to make the tag live on your website or app.<\/p>\n\n\n\n<h3 id='save-and-publish-the-tag-configuration'  id=\"boomdevs_6\" class=\"wp-block-heading\">Save and Publish the Tag Configuration<\/h3>\n\n\n\n<p>We have saved the tag configuration in the previous step. Once it is saved, you can publish it. To publish the tag configuration, click the &#8220;<strong>Submit<\/strong>&#8221; button at the screen&#8217;s top-right corner.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon.webp\" alt=\"Submit the Tag\" class=\"wp-image-69190\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon-768x350.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/32_32_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the dialog box, provide a version name or description for your changes to the tag configuration. This helps identify and track different versions of your container configuration.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"467\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon.webp\" alt=\"Submission Configuration\" class=\"wp-image-69191\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon-768x350.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/33_33_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, click the &#8220;<strong>Publish<\/strong>&#8221; button to publish the tag configuration. It will make the changes live on your website or app.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon.webp\" alt=\"Publish the Tag\" class=\"wp-image-69192\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon-768x354.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/34_34_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>It will take some time to get published.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon.webp\" alt=\"Tag Published\" class=\"wp-image-69193\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/35_35_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Congratulations! You have successfully saved and published the tag configuration in Google Tag Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"472\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon.webp\" alt=\"Data Showing\" class=\"wp-image-69194\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon-768x354.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/36_36_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The tag will now be active and capture the specified data based on the configured triggers.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon.webp\" alt=\"Live Data\" class=\"wp-image-69195\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon-300x137.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon-768x350.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon-36x16.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/37_37_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 id='implement-the-google-tag-manager-container-code-in-your-php-templates'  id=\"boomdevs_7\" class=\"wp-block-heading\">Implement the Google Tag Manager Container code in your PHP templates<\/h3>\n\n\n\n<p>To implement the Google Tag Manager Container code in your PHP templates, follow these steps:<\/p>\n\n\n\n<p>Again, go to the Google Tag Manager Container dashboard and navigate to the Admin tab. You will see a list of options on the right side; select the &#8220;<strong>Install Google Tag Manager<\/strong>&#8221; option as we did earlier at the time of Google Tag Manager Installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon.webp\" alt=\"Install Google Tag Manager.png\" class=\"wp-image-69196\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/38_38_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You will see two sets of code provided here, one for the &lt;head&gt; section and another for the &lt;body&gt; section.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon.webp\" alt=\"Install Google Tag Manager.png\" class=\"wp-image-69197\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon-300x160.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon-768x409.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon-24x13.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon-36x19.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/39_39_11zon-48x26.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Copy the container code for the &lt;body&gt; section. It should look similar to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;!-- Google Tag Manager (noscript) --&gt;\n\n&lt;noscript&gt;&lt;iframe src=\"https:\/\/www.googletagmanager.com\/ns.html?id=GTM-MTL5JFC\"\n\nheight=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"&gt;&lt;\/iframe&gt;&lt;\/noscript&gt;\n\n&lt;!-- End Google Tag Manager (noscript) --&gt;\n<\/pre>\n\n\n\n<p>Paste the code into the &lt;body&gt; section of your website&#8217;s HTML or PHP template file just after the opening &lt;body&gt; tag.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"384\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon.webp\" alt=\"Add Script\" class=\"wp-image-69198\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon-300x113.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon-768x288.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon-24x9.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon-36x14.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/40_40_11zon-48x18.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Save the changes to your website&#8217;s file and publish your changes in Google Tag Manager to make the container code live on your website.<\/p>\n\n\n\n<p>Once you are done making changes, go to your website and inspect the search to ensure the Google Tag Manager Container code in your PHP templates is implemented successfully.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon.webp\" alt=\"Verify\" class=\"wp-image-69199\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon-300x139.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon-768x356.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/41_41_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once the Google Tag Manager Container code in your PHP templates is implemented, it will work and provide the necessary foundation for managing and deploying tags, including the integration with GA4 and other tracking tools. Remember to test the implementation to ensure the container code functions correctly and captures the desired data.<\/p>\n\n\n\n<h3 id='test-the-implementation'  id=\"boomdevs_8\" class=\"wp-block-heading\">Test the Implementation<\/h3>\n\n\n\n<p>To test the implementation or to check whether you have done the whole process correctly, go to Google Analytics (analytics.google.com) and open your property. On the home page or dashboard, you can see the real-time results. Allow some users to visit your website and check the results or user activities in real-time monitoring on GA4.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon.webp\" alt=\"Real Time Data\" class=\"wp-image-69200\" srcset=\"https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon.webp 1024w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon-300x138.webp 300w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon-768x353.webp 768w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon-24x11.webp 24w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon-36x17.webp 36w, https:\/\/devrims.com\/blog\/wp-content\/uploads\/2024\/08\/42_42_11zon-48x22.webp 48w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Congratulations! You have completed the integration process of PHP with GA4 using Google Tag Manager. Here you go; we can see the results.<\/p>\n\n\n\n<h2 id='conclusion'  id=\"boomdevs_9\" class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Congratulations! You&#8217;ve successfully integrated Google Analytics 4 with your PHP website using Google Tag Manager. By following these steps, you&#8217;ve set up a strong system for tracking user interactions and gathering valuable insights. Remember, testing your setup is important to make sure everything is working properly. With GTM, you can also easily manage and update your tags in the future. Now that everything is live, you can use the data to make informed decisions and improve your website&#8217;s performance and user experience.<\/p>\n\n\n\n<h4 id='related-topics'  id=\"boomdevs_10\" class=\"wp-block-heading\">Related Topics:<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/devrims.com\/blog\/google-analytics-4-magento\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Connect Google Analytics 4 With Your Magento Store<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/devrims.com\/blog\/google-analytics-4-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">Easy Way To Add Google Analytics 4 to WordPress Sites (With or Without Plugins)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/devrims.com\/blog\/how-to-install-classicpress-on-the-cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install ClassicPress on the Cloud<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/devrims.com\/blog\/setup-microsoft-clarity-wordpress-magento-php\/\" target=\"_blank\" rel=\"noreferrer noopener\">What is Microsoft Clarity? How to use MS Clarity on WordPress, Magento, and PHP?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s data-driven world, understanding user behavior and making informed decisions is essential for the success of any online journey. That&#8217;s where Google Analytics 4 (GA4) steps in, providing valuable insights into website performance and user interactions. If you are a PHP developer seeking to tackle the full potential of GA4, you have come to [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":68307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[14],"tags":[58],"ad-banner":[85],"blog-popup":[82],"cta-banner":[],"class_list":["post-52711","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php-development","ad-banner-php","blog-popup-app-php"],"acf":[],"_links":{"self":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/comments?post=52711"}],"version-history":[{"count":19,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52711\/revisions"}],"predecessor-version":[{"id":69204,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/posts\/52711\/revisions\/69204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/media\/68307"}],"wp:attachment":[{"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/media?parent=52711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/categories?post=52711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/tags?post=52711"},{"taxonomy":"ad-banner","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/ad-banner?post=52711"},{"taxonomy":"blog-popup","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/blog-popup?post=52711"},{"taxonomy":"cta-banner","embeddable":true,"href":"https:\/\/devrims.com\/blog\/wp-json\/wp\/v2\/cta-banner?post=52711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}