{"id":7832,"date":"2026-04-21T09:46:57","date_gmt":"2026-04-21T07:46:57","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7832"},"modified":"2026-04-21T09:46:59","modified_gmt":"2026-04-21T07:46:59","slug":"localizarea-codului-google-analytics-ga4-pentru-wordpress","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/locating-your-google-analytics-ga4-code-for-wordpress\/","title":{"rendered":"Localizarea codului Google Analytics (GA4) pentru WordPress"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\" id=\"p-rc_c54cc3e96516ff11-343\">In <strong>April 2026<\/strong>, the process for getting your tracking code remains centered on the <strong>Google Tag (gtag.js)<\/strong>. Since the retirement of Universal Analytics, you are looking specifically for a <strong>Measurement ID<\/strong> (which starts with <strong>G-<\/strong>) rather than the old &#8220;UA-&#8221; code.<sup><\/sup><\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"p-rc_c54cc3e96516ff11-344\">On your <strong>mybox<\/strong> WordPress site, you generally have two choices: use just the <strong>ID<\/strong> (if using a plugin) or the full <strong>Code Snippet<\/strong> (if adding it manually).<sup><\/sup><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/locating-your-google-analytics-ga4-code-for-wordpress\/#How_to_Find_Your_Code_Step-by-Step\" >How to Find Your Code (Step-by-Step)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/locating-your-google-analytics-ga4-code-for-wordpress\/#Where_to_Place_the_Code_in_WordPress\" >Where to Place the Code in WordPress<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/locating-your-google-analytics-ga4-code-for-wordpress\/#2026_Verification_Checklist\" >2026 Verification Checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/locating-your-google-analytics-ga4-code-for-wordpress\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Find_Your_Code_Step-by-Step\"><\/span><strong>How to Find Your Code (Step-by-Step)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Log in to Google Analytics:<\/strong> Go to <a href=\"https:\/\/analytics.google.com\" target=\"_blank\" rel=\"noreferrer noopener\">analytics.google.com<\/a>.<\/li>\n\n\n\n<li><strong>Navigate to Admin:<\/strong> Click the <strong>Admin<\/strong> (gear icon) in the bottom-left corner.<\/li>\n\n\n\n<li><strong>Open Data Streams:<\/strong> Under the <em>Data collection and modification<\/em> section (Property column), click <strong>Data Streams<\/strong>.<\/li>\n\n\n\n<li><strong>Select Your Website:<\/strong> Click on your active web stream. This opens the <strong>Web stream details<\/strong>.<\/li>\n\n\n\n<li><strong>Identify Your ID:<\/strong> Your <strong>Measurement ID<\/strong> (e.g., <code>G-XXXXXXXXXX<\/code>) is displayed in the top right. Copy this if you are using a plugin.<\/li>\n\n\n\n<li><strong>Get the Full Code:<\/strong> Scroll down to the <em>Google tag<\/em> section and click <strong>View tag instructions<\/strong>.\n<ul class=\"wp-block-list\">\n<li>Select <strong>Install manually<\/strong>.<\/li>\n\n\n\n<li>Copy the entire JavaScript snippet that begins with &#8220;.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_to_Place_the_Code_in_WordPress\"><\/span><strong>Where to Place the Code in WordPress<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-1586712378\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">Once you have your code or ID, choose the method that best fits your technical comfort level on <strong>mybox<\/strong>:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Method A: The Official Plugin (Recommended)<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Use <strong>Site Kit by Google<\/strong>. It\u2019s the most stable way to connect your site without touching a single line of code.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action:<\/strong> Install the plugin, click &#8220;Sign in with Google,&#8221; and it will automatically find your <strong>G-<\/strong> ID and place the code for you.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Method B: Lightweight &#8220;Insert Headers&#8221; Plugin<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t want a heavy plugin like Site Kit, use <strong>Header Footer Code Manager<\/strong> or <strong>WPCode<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action:<\/strong> Create a new &#8220;Snippet,&#8221; select &#8220;Header,&#8221; and paste the full <code>gtag.js<\/code> code you copied from Google. This ensures the code stays active even if you change your WordPress theme.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Method C: Manual Theme Edit (For Advanced Users)<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"p-rc_c54cc3e96516ff11-352\">You can paste the code directly into your theme files, but <strong>be careful<\/strong>: if you update your theme, this code may be overwritten unless you use a <strong>Child Theme<\/strong>.<sup><\/sup><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Action:<\/strong> Go to <strong>Appearance \u279c Theme File Editor<\/strong> and find <code>header.php<\/code>. Paste the code immediately after the opening <code>&lt;head><\/code> tag.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2026_Verification_Checklist\"><\/span><strong>2026 Verification Checklist<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Test<\/th><th>Tool<\/th><th>Expected Result<\/th><\/tr><\/thead><tbody><tr><td><strong>Real-time Check<\/strong><\/td><td>GA4 Dashboard \u279c Reports \u279c Real-time<\/td><td>You should see &#8220;1 user&#8221; (you) active on the site.<\/td><\/tr><tr><td><strong>Debug Mode<\/strong><\/td><td>Google Tag Assistant<\/td><td>A green icon confirming your <code>G-<\/code> ID is found.<\/td><\/tr><tr><td><strong>Consent Mode<\/strong><\/td><td>Cookie Banner<\/td><td>In 2026, ensure your code only fires <em>after<\/em> the user accepts cookies to remain GDPR compliant.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Export to Sheets<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span><strong>Summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"p-rc_c54cc3e96516ff11-353\">The &#8220;secret key&#8221; for your <strong>mybox<\/strong> analytics is the <strong>Measurement ID<\/strong>.<sup><\/sup> Whether you paste the full code manually or just use the ID in a plugin, ensure it is placed in the <strong>Header<\/strong> so it loads before the rest of your content for the most accurate data.<sup><\/sup><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[28,58],"manual_kb_tag":[],"class_list":["post-7832","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-others","manualknowledgebasecat-web-applications-cms"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7832\/revisions"}],"predecessor-version":[{"id":7833,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7832\/revisions\/7833"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=7832"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7832"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=7832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}