{"id":24331,"date":"2020-01-09T12:33:15","date_gmt":"2020-01-09T17:33:15","guid":{"rendered":"http:\/\/webtargetinc.com\/newwp\/global-site-tag-gtag\/"},"modified":"2020-02-27T08:28:19","modified_gmt":"2020-02-27T13:28:19","slug":"global-site-tag-gtag","status":"publish","type":"post","link":"https:\/\/webtargetinc.com\/en\/global-site-tag-gtag\/","title":{"rendered":"What Is Global Site Tag (gtag.js) In Google Analytics?"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\"  style='background-color: rgba(255,255,255,0);background-position: center center;background-repeat: no-repeat;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;'><div class=\"fusion-builder-row fusion-row \"><div  class=\"fusion-layout-column fusion_builder_column fusion_builder_column_1_1 fusion-builder-column-0 fusion-one-full fusion-column-first fusion-column-last 1_1\"  style='margin-top:25px;margin-bottom:25px;'><div class=\"fusion-column-wrapper\" style=\"padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;\"   data-bg-url=\"\"><div class=\"fusion-text\"><p>Google recently started to show a new type of tracking option inside of Analytics called <strong>Global Site Tag<\/strong> (gtag.js), replacing the Universal Analytics (analytics.js) tracking option. Going forward this will be the suggested tracking script.<\/p>\n<\/div><div class=\"imageframe-align-center\"><span class=\"fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1-300x169.jpg\" width=\"300\" height=\"169\" alt=\"\" title=\"what-is-gtag-analytics-1024&#215;577-3-copie\" class=\"img-responsive wp-image-24124\" srcset=\"https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1-200x113.jpg 200w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1-400x225.jpg 400w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1-600x338.jpg 600w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1-800x451.jpg 800w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/01\/what-is-gtag-analytics-1024x577-3-copie-1.jpg 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 300px\" \/><\/span><\/div><div class=\"fusion-text\"><h3>What is Global Site Tag?<\/h3>\n<p>Basically it is the new tracking script for Google Analytics. This will replace the current Universal tracking script. Google will start to show the new tag for users more and more as time goes on and more features are added.\u00a0 It is Google&#8217;s way of standardizing all of their different tracking methods. You can see how the script is hosted at Google Tag Manager hints towards the best practice of consolidating script management into one location.<\/p>\n<h3>Can I migrate analytics.js to gtag.js?<\/h3>\n<p>Yes absolutely! Check out <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/gtagjs\/migration\">Google&#8217;s migration guide here.<\/a><\/p>\n<h3>Do I need to migrate now?<\/h3>\n<p>Nope, and I would not suggest it at the time of writing this article as it is still in beta, and there will be a lot of new features added in the coming, weeks, months, and maybe year. There is no clear advantage to changing to Google Global Site Tag yet. But keep it in mind for upcoming maintenance tasks that your developer may be doing, so they can add it later when ready.<\/p>\n<h3>Old Analytics Code?<\/h3>\n<p>Can&#8217;t find the analytics.js code that used to show in Analytics? Visit the Google Guide on analytics.js for the original code. <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/tracking-snippet-reference\">Click here<\/a><\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-parallax-none nonhundred-percent-fullwidth hundred-percent-height hundred-percent-height-center-content non-hundred-percent-height-scrolling\"  style='background-color: rgba(255,255,255,0);background-image: url(\"https:\/\/webtargetinc.com\/wp-content\/uploads\/2019\/01\/register-cta-bg.png\");background-position: center center;background-repeat: no-repeat;padding-top:5%;padding-right:0px;padding-bottom:4%;padding-left:0px;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;'><div class=\"fusion-fullwidth-center-content\"><div class=\"fusion-builder-row fusion-row \"><div  class=\"fusion-layout-column fusion_builder_column fusion_builder_column_3_5 fusion-builder-column-1 fusion-three-fifth fusion-column-first 3_5\"  style='margin-top:25px;margin-bottom:25px;width:60%;width:calc(60% - ( ( 4% ) * 0.6 ) );margin-right: 4%;'><div class=\"fusion-column-wrapper\" style=\"padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;\"   data-bg-url=\"\"><style type=\"text\/css\"><\/style><div class=\"fusion-title title fusion-title-1 fusion-sep-none fusion-title-text fusion-title-size-two\" style=\"font-size:60px;margin-top:20px;margin-bottom:20px;\"><h2 class=\"title-heading-left\" style=\"margin:0;font-size:1em;line-height:1.25em;color:#ffffff;\">The Webtarget Guide to Digital Marketing<\/h2><\/div><div class=\"fusion-text\"><p style=\"font-size: 15px; color: #ffffff;\">Find out about the latest trends, performance benchmarks and best practices in online marketing. Subscribe to our newsletter to receive our free online marketing guide for 2020.<\/p>\n<\/div><script type=\"text\/javascript\">\n\/* <![CDATA[ *\/\nvar gform;gform||(document.addEventListener(\"gform_main_scripts_loaded\",function(){gform.scriptsLoaded=!0}),document.addEventListener(\"gform\/theme\/scripts_loaded\",function(){gform.themeScriptsLoaded=!0}),window.addEventListener(\"DOMContentLoaded\",function(){gform.domLoaded=!0}),gform={domLoaded:!1,scriptsLoaded:!1,themeScriptsLoaded:!1,isFormEditor:()=>\"function\"==typeof InitializeEditor,callIfLoaded:function(o){return!(!gform.domLoaded||!gform.scriptsLoaded||!gform.themeScriptsLoaded&&!gform.isFormEditor()||(gform.isFormEditor()&&console.warn(\"The use of gform.initializeOnLoaded() is deprecated in the form editor context and will be removed in Gravity Forms 3.1.\"),o(),0))},initializeOnLoaded:function(o){gform.callIfLoaded(o)||(document.addEventListener(\"gform_main_scripts_loaded\",()=>{gform.scriptsLoaded=!0,gform.callIfLoaded(o)}),document.addEventListener(\"gform\/theme\/scripts_loaded\",()=>{gform.themeScriptsLoaded=!0,gform.callIfLoaded(o)}),window.addEventListener(\"DOMContentLoaded\",()=>{gform.domLoaded=!0,gform.callIfLoaded(o)}))},hooks:{action:{},filter:{}},addAction:function(o,r,e,t){gform.addHook(\"action\",o,r,e,t)},addFilter:function(o,r,e,t){gform.addHook(\"filter\",o,r,e,t)},doAction:function(o){gform.doHook(\"action\",o,arguments)},applyFilters:function(o){return gform.doHook(\"filter\",o,arguments)},removeAction:function(o,r){gform.removeHook(\"action\",o,r)},removeFilter:function(o,r,e){gform.removeHook(\"filter\",o,r,e)},addHook:function(o,r,e,t,n){null==gform.hooks[o][r]&&(gform.hooks[o][r]=[]);var d=gform.hooks[o][r];null==n&&(n=r+\"_\"+d.length),gform.hooks[o][r].push({tag:n,callable:e,priority:t=null==t?10:t})},doHook:function(r,o,e){var t;if(e=Array.prototype.slice.call(e,1),null!=gform.hooks[r][o]&&((o=gform.hooks[r][o]).sort(function(o,r){return o.priority-r.priority}),o.forEach(function(o){\"function\"!=typeof(t=o.callable)&&(t=window[t]),\"action\"==r?t.apply(null,e):e[0]=t.apply(null,e)})),\"filter\"==r)return e[0]},removeHook:function(o,r,t,n){var e;null!=gform.hooks[o][r]&&(e=(e=gform.hooks[o][r]).filter(function(o,r,e){return!!(null!=n&&n!=o.tag||null!=t&&t!=o.priority)}),gform.hooks[o][r]=e)}});\n\/* ]]> *\/\n<\/script>\n\n                <div class='gf_browser_gecko gform_wrapper gform_legacy_markup_wrapper gform-theme--no-framework' data-form-theme='legacy' data-form-index='0' id='gform_wrapper_6' ><form method='post' enctype='multipart\/form-data'  id='gform_6'  action='\/en\/wp-json\/wp\/v2\/posts\/24331' data-formid='6' novalidate>\n                        <div class='gform-body gform_body'><ul id='gform_fields_6' class='gform_fields top_label form_sublabel_below description_below validation_below'><li id=\"field_6_1\" class=\"gfield gfield--type-email gfield_contains_required field_sublabel_below gfield--no-description field_description_below hidden_label field_validation_below gfield_visibility_visible\"  ><label class='gfield_label gform-field-label' for='input_6_1'>Email Address<span class=\"gfield_required\"><span class=\"gfield_required gfield_required_asterisk\">*<\/span><\/span><\/label><div class='ginput_container ginput_container_email'>\n                            <input name='input_1' id='input_6_1' type='email' value='' class='medium'   placeholder='Email address' aria-required=\"true\" aria-invalid=\"false\"  \/>\n                        <\/div><\/li><\/ul><\/div>\n        <div class='gform-footer gform_footer top_label'> <input type='submit' id='gform_submit_button_6' class='gform_button button' onclick='gform.submission.handleButtonClick(this);' data-submission-type='submit' value='Send'  \/> \n            <input type='hidden' class='gform_hidden' name='gform_submission_method' data-js='gform_submission_method_6' value='postback' \/>\n            <input type='hidden' class='gform_hidden' name='gform_theme' data-js='gform_theme_6' id='gform_theme_6' value='legacy' \/>\n            <input type='hidden' class='gform_hidden' name='gform_style_settings' data-js='gform_style_settings_6' id='gform_style_settings_6' value='[]' \/>\n            <input type='hidden' class='gform_hidden' name='is_submit_6' value='1' \/>\n            <input type='hidden' class='gform_hidden' name='gform_submit' value='6' \/>\n            \n            <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' \/>\n            <input type='hidden' class='gform_hidden' name='state_6' value='WyJbXSIsImE3ZGZhOWIwZWIxMWQyZmI1ODUxNTM0MjE1ZTk2ZjA5Il0=' \/>\n            <input type='hidden' autocomplete='off' class='gform_hidden' name='gform_target_page_number_6' id='gform_target_page_number_6' value='0' \/>\n            <input type='hidden' autocomplete='off' class='gform_hidden' name='gform_source_page_number_6' id='gform_source_page_number_6' value='1' \/>\n            <input type='hidden' name='gform_field_values' value='' \/>\n            \n        <\/div>\n                        <p style=\"display: none !important;\"><label>&#916;<textarea name=\"ak_hp_textarea\" cols=\"45\" rows=\"8\" maxlength=\"100\"><\/textarea><\/label><input type=\"hidden\" id=\"ak_js_1\" name=\"ak_js\" value=\"83\"\/><script>document.getElementById( \"ak_js_1\" ).setAttribute( \"value\", ( new Date() ).getTime() );<\/script><\/p><\/form>\n                        <\/div><script type=\"text\/javascript\">\n\/* <![CDATA[ *\/\n gform.initializeOnLoaded( function() {gformInitSpinner( 6, 'https:\/\/webtargetinc.com\/wp-content\/plugins\/gravityforms\/images\/spinner.svg', true );jQuery('#gform_ajax_frame_6').on('load',function(){var contents = jQuery(this).contents().find('*').html();var is_postback = contents.indexOf('GF_AJAX_POSTBACK') >= 0;if(!is_postback){return;}var form_content = jQuery(this).contents().find('#gform_wrapper_6');var is_confirmation = jQuery(this).contents().find('#gform_confirmation_wrapper_6').length > 0;var is_redirect = contents.indexOf('gformRedirect(){') >= 0;var is_form = form_content.length > 0 && ! is_redirect && ! is_confirmation;var mt = parseInt(jQuery('html').css('margin-top'), 10) + parseInt(jQuery('body').css('margin-top'), 10) + 100;if(is_form){jQuery('#gform_wrapper_6').html(form_content.html());if(form_content.hasClass('gform_validation_error')){jQuery('#gform_wrapper_6').addClass('gform_validation_error');} else {jQuery('#gform_wrapper_6').removeClass('gform_validation_error');}setTimeout( function() { \/* delay the scroll by 50 milliseconds to fix a bug in chrome *\/  }, 50 );if(window['gformInitDatepicker']) {gformInitDatepicker();}if(window['gformInitPriceFields']) {gformInitPriceFields();}var current_page = jQuery('#gform_source_page_number_6').val();gformInitSpinner( 6, 'https:\/\/webtargetinc.com\/wp-content\/plugins\/gravityforms\/images\/spinner.svg', true );jQuery(document).trigger('gform_page_loaded', [6, current_page]);window['gf_submitting_6'] = false;}else if(!is_redirect){var confirmation_content = jQuery(this).contents().find('.GF_AJAX_POSTBACK').html();if(!confirmation_content){confirmation_content = contents;}jQuery('#gform_wrapper_6').replaceWith(confirmation_content);jQuery(document).trigger('gform_confirmation_loaded', [6]);window['gf_submitting_6'] = false;wp.a11y.speak(jQuery('#gform_confirmation_message_6').text());}else{jQuery('#gform_6').append(contents);if(window['gformRedirect']) {gformRedirect();}}jQuery(document).trigger(\"gform_pre_post_render\", [{ formId: \"6\", currentPage: \"current_page\", abort: function() { this.preventDefault(); } }]);                if (event && event.defaultPrevented) {                return;         }        const gformWrapperDiv = document.getElementById( \"gform_wrapper_6\" );        if ( gformWrapperDiv ) {            const visibilitySpan = document.createElement( \"span\" );            visibilitySpan.id = \"gform_visibility_test_6\";            gformWrapperDiv.insertAdjacentElement( \"afterend\", visibilitySpan );        }        const visibilityTestDiv = document.getElementById( \"gform_visibility_test_6\" );        let postRenderFired = false;                function triggerPostRender() {            if ( postRenderFired ) {                return;            }            postRenderFired = true;            gform.core.triggerPostRenderEvents( 6, current_page );            if ( visibilityTestDiv ) {                visibilityTestDiv.parentNode.removeChild( visibilityTestDiv );            }        }        function debounce( func, wait, immediate ) {            var timeout;            return function() {                var context = this, args = arguments;                var later = function() {                    timeout = null;                    if ( !immediate ) func.apply( context, args );                };                var callNow = immediate && !timeout;                clearTimeout( timeout );                timeout = setTimeout( later, wait );                if ( callNow ) func.apply( context, args );            };        }        const debouncedTriggerPostRender = debounce( function() {            triggerPostRender();        }, 200 );        if ( visibilityTestDiv && visibilityTestDiv.offsetParent === null ) {            const observer = new MutationObserver( ( mutations ) => {                mutations.forEach( ( mutation ) => {                    if ( mutation.type === 'attributes' && visibilityTestDiv.offsetParent !== null ) {                        debouncedTriggerPostRender();                        observer.disconnect();                    }                });            });            observer.observe( document.body, {                attributes: true,                childList: false,                subtree: true,                attributeFilter: [ 'style', 'class' ],            });        } else {            triggerPostRender();        }    } );} ); \n\/* ]]> *\/\n<\/script>\n<div class=\"fusion-clearfix\"><\/div><\/div><\/div><div  class=\"fusion-layout-column fusion_builder_column fusion_builder_column_2_5 fusion-builder-column-2 fusion-two-fifth fusion-column-last 2_5\"  style='margin-top:25px;margin-bottom:25px;width:40%;width:calc(40% - ( ( 4% ) * 0.4 ) );'><div class=\"fusion-column-wrapper\" style=\"padding: 0px 0px 0px 0px;background-position:left top;background-repeat:no-repeat;-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;\"   data-bg-url=\"\"><span class=\"fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing.png\" width=\"959\" height=\"530\" alt=\"\" title=\"The Webtarget Guide to Digital Marketing\" class=\"img-responsive wp-image-24770\" srcset=\"https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing-200x111.png 200w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing-400x221.png 400w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing-600x332.png 600w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing-800x442.png 800w, https:\/\/webtargetinc.com\/wp-content\/uploads\/2020\/02\/The-Webtarget-Guide-to-Digital-Marketing.png 959w\" sizes=\"auto, (max-width: 1000px) 100vw, 600px\" \/><\/span><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":24862,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[151,152],"tags":[153,154],"class_list":["post-24331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-francais-en","category-google-analytics-en","tag-global-site-tag-en","tag-google-analytics-en"],"_links":{"self":[{"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/posts\/24331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/comments?post=24331"}],"version-history":[{"count":4,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/posts\/24331\/revisions"}],"predecessor-version":[{"id":24789,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/posts\/24331\/revisions\/24789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/media\/24862"}],"wp:attachment":[{"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/media?parent=24331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/categories?post=24331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webtargetinc.com\/en\/wp-json\/wp\/v2\/tags?post=24331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}