Verify Your Site With Google Search Console

Other languagesالعربيةDeutschEspañolFrançaisעִבְרִיתBahasa IndonesiaItaliano日本語한국어NederlandsPortuguês do BrasilРусскийSvenskaTürkçe简体中文繁體中文
Verify your website with Google to measure your site’s search traffic and performance, fix issues, and make your site shine in Google’s search results. This guide will show you how to verify your site ownership to use Google Search Console.
Site Verification Services
While most site verification tools will ask you to add an “HTML tag” or “meta tag” to your site’s header, we’ve simplified the process by providing specific tools for adding the required tag to your WordPress.com website.
From your site’s dashboard, visit Tools → Marketing (or Jetpack → Settings if using WP-Admin) and select the Traffic tab to access the site verification tools.
In addition to the Google verification steps described in this guide, you can verify your site with Bing, Pinterest, Yandex, and Facebook.
Connect to Google Search Console
We recommend two methods to verify your site with Google. You only need to complete one method.
Method 1: Verify With an HTML Tag
To get started with Google Search Console, take the following steps:
- Visit the Google Search Console homepage and sign in with your Google account.
- In the upper left corner of the Google Search Console dashboard, click “Add Property“:
Add property in Google Search Console.
- You will be provided with two “property type” options. Select the “URL prefix” method here.
- Enter your WordPress.com website’s domain address (including https:// and without the www) and click the “Continue” button.
Select the URL Prefix option
- On the next screen, in the “Verify ownership” pop-up, scroll down to “Other verification methods” and click on “HTML Tag“:
Select the HTML tag option
- Here, you’ll find a line of HTML code that resembles this:
Example of HTML tag option
- Click the “Copy” button to copy the meta tag to your computer’s clipboard. Be careful to copy the full code here without missing any characters.
- Open a new browser tab or window and visit your WordPress.com site’s dashboard.
- In the left side options, navigate to Tools → Marketing (or Jetpack → Settings if using WP-Admin).
- Click on the Traffic tab at the top.
- Scroll down to the “Site verification services” section and locate the box for Google.
- Paste in the code provided earlier from Google.
- Click the “Save settings” button.
Enter your Google meta tag in Site Verification Services
- Return to the Google Search Console verification page and click the “Verify” button.
Verify the meta tag in Google Webmaster tools
Method 2: Verify Using a DNS Record
If you cannot use the HTML tag method described above, you can alternatively use a DNS record (specifically a TXT record) to verify your domain name with Google. You do not need to complete these steps if you successfully verified your domain using the HTML tag method described in the previous section of this guide.
To verify your site with Google using the domain method, follow these steps:
- Visit the Google Search Console homepage and sign in with your Google account.
- In the upper left corner of the Google Search Console dashboard, click “Add Property“:
Add property to Google Search Console.
- You will be provided with two property type options. Select the Domain method here.
The Domain option will only work on your WordPress.com site if you have a custom domain name.
- Enter your site’s domain name without the https:// or www, for example, yourgroovydomain.com, and click the “Continue” button.
- Google will now attempt to validate where your domain is registered and offer the option to verify your domain with WordPress.com. You must ignore this and select the “Any DNS Provider” option to continue:
- Copy the TXT record provided in the “Verify domain ownership via DNS record” screen:
Verify Domain with DNS Record
- In a new browser tab or window, open your WordPress.com account, navigate to Upgrades → Domains, and click on the domain you wish to verify.
- Clickon “DNS records” and then click the “Manage” button.
- In the upper right corner, click the “Add a record” button.
- Change the Type drop-down to TXT. Do not adjust the Name or TTL fields. Paste the text code you got from Google into the Text field, as shown in the image below:
Adding your TXT record for verifying your domain with Google.
- Click the “Add New DNS Record” button to save the new record.
- Finally, return to the Google screen and click the “Verify” button.
- In most cases, the verification is immediate, but it may take up to 72 hours for Google to recognize your domain as verified.
Once you have verified your site with Google using one of the above methods, you may upload your sitemap to Google by following these steps:
- Visit your WordPress.com site’s dashboard.
- In the left side options, navigate to Tools → Marketing (or Jetpack → Settings if using WP-Admin).
- Click on the Traffic tab.
- Scroll down to the Sitemaps section.
- Copy your sitemap URL, which is typically your domain name followed by /sitemap.xml.
- Navigate to the Sitemaps section of Google Search Console at Index → Sitemaps:
- Insert your sitemap URL here and click the “Submit” button.
If you receive an error after uploading the sitemap, please make sure that your website is public and try to upload it again.
Handle Errors in Google Search Console
You may receive emails from Google highlighting issues they are having with indexing certain pages of your site. Common errors include:
- Submitted URL marked ‘noindex’: The URL is requested not to be listed in Google search results because of this setting or via a third-party plugin.
- Blocked by robots.txt: The URL is requested not to be listed in Google search results according to your site’s robots.txt file.
- Not found (404): The page has been deleted from your site or no longer exists at the same URL.
- Redirect Error: You may have changed your site’s primary address a few times or set up a redirect incorrectly using a redirection plugin.
Remember that an “error” does not necessarily imply an issue with your website that you need to fix. Certain pages of your site will not be indexed on purpose, such as your site’s /wp-admin URL, a URL that’s a duplicate of another page, or a 404 for a page you’ve removed and have no replacement for.
If Google highlights an indexing error, you can use its tools to identify which specific URL on your site is causing the issue. If the page does not exist or you don’t wish for that page to appear in search results, you can likely ignore the error or request Google to check (validate) it again.
Google offers detailed resources for learning more about any errors or warnings they display. Click here for more information on Google’s Page Indexing report.
Was this guide helpful for you?
What can we do to make this guide more helpful?
Copied to clipboard!
<![CDATA[ ( function() { 'use strict'; var setupAnalytics = function() { window.a8cAnalyticsConfig = {"cookieBanner":{"version":"2","cssZIndex":50001,"skipBanner":false,"cookieDomain":"wordpress.com","v1CookieName":"sensitive_pixel_option","v2CookieName":"sensitive_pixel_options","v1Text":"Our websites and dashboards use cookies. By continuing, you agree to their use. Learn more, including how to control cookies.”,”v2Text”:”As an open source company, we take your privacy seriously and want to be as transparent as possible. So: We use cookies to collect some personal data from you (like your browsing data, IP addresses, and other unique identifiers). Some of these cookies we absolutely need in order to make things work, and others you can choose in order to optimize your experience while using our site and services.”,”v2OptionsText”:”Your privacy is critically important to us. We and our partners use, store, and process your personal data to optimize: our website such as by improving security or conducting analytics, marketing activities to help deliver relevant marketing or content, and your user experience such as by remembering your account name, language settings, or cart information, where applicable. You can customize your cookie settings below. Learn more in our Privacy Policy and Cookie Policy.”,”v2EssentialOptionHeading”:”Required”,”v2EssentialOptionText”:”These cookies are essential for our websites and services to perform basic functions and are necessary for us to operate certain features, like allowing registered users to authenticate and perform account-related functions, storing preferences set by users (like account name, language, and location), and ensuring our services operate properly.”,”v2AnalyticsOptionHeading”:”Analytics”,”v2AnalyticsOptionText”:”These cookies allow us to optimize performance by collecting information on how users interact with our websites.”,”v2AdvertisingOptionHeading”:”Advertising”,”v2AdvertisingOptionText”:”We and our advertising partners set these cookies to provide you with relevant content and to understand that contentu2019s effectiveness.”,”v1ButtonText”:”Got It!”,”v2CustomizeButtonText”:”Customize”,”v2AcceptAllButtonText”:”Accept all”,”v2AcceptSelectionButtonText”:”Accept selection”,”hiddenConsents”:[],”isLoggedIn”:false},”doNotSellDialog”:{“contactEmailAddress”:”privacypolicyupdates@automattic.com”},”adminAnalytics”:”analytics-wpcom-admin.php”,”fireAnalyticsOptions”:[]}; }; if ( window.defQueue && defQueue.isLOHP && defQueue.isLOHP === 2020 ) { defQueue.items.push( setupAnalytics ); } else { setupAnalytics(); } } )(); ]]>
{ let { target: element } = event; let foundElement = null; while ( element && !foundElement ) { for ( const selector of selectors ) { if ( element.matches( selector ) ) { foundElement = element; break; } } element = element.parentElement; } return foundElement; } /** * Establish the closest parent from an element matching * a given list of selectors. Selectors can be css classes, IDs, * element types, etc. (e.g. ‘.my-class’, ‘#my-id’, ‘div’, etc.) */ const getClosestMatchingAncestor = ( event, selectors ) => { let { target: element } = event; let foundElement; for ( const selector of selectors ) { foundElement = element.closest( selector ); if ( foundElement ) { break; } } return foundElement; } /** * Main function to setup analytics. */ const setupAnalytics = () => { /** * Returns the current page path. */ function getCurrentPagePath( pathname = ” ) { return ( pathname || window.location.pathname ).replace( /^/|/$/g, ” ); } /** * Returns the current page name. */ function getCurrentPageName( pathname = ” ) { return getCurrentPagePath( pathname ).replace( getLocaleInPagePathRegExp(), ” ); } /** * Returns the current page locale. */ function getCurrentPageLocale() { const currentPagePath = getLocaleInPagePathRegExp().exec( getCurrentPagePath() ); return getCurrentPagePath !== null && getCurrentPagePath.length === 2 ? getCurrentPagePath[1] : ”; } /** * Helper function to extract locale from page path. */ function getLocaleInPagePathRegExp() { return /^(af|als|am|an|ar|arc|as|ast|av|ay|az|ba|bel|bg|bm|bn|bo|br|bs|ca|ce|ckb|cs|csb|cv|cy|da|de|dv|dz|el|el-po|en|en-gb|eo|es|es-mx|et|eu|fa|fi|fo|fr|fr-be|fr-ca|fr-ch|fur|fy|ga|gd|gl|gn|gu|he|hi|hr|hu|hy|ia|id|ii|ilo|is|it|ja|ka|kir|km|kn|ko|kk|ks|kv|la|li|lo|lv|lt|mk|ml|mwl|mn|mr|ms|mya|nah|nap|ne|nds|nl|nn|nb|non|nv|oci|or|os|pa|pl|ps|pt|pt-br|qu|ro|ru|rup|sc|si|sk|skr|sl|snd|so|sq|sr|su|sv|ta|te|th|tl|tir|tr|tt|ty|udm|ug|uk|ur|uz|vec|vi|wa|xal|yi|yo|za|zh-cn|zh-hk|zh-tw)(?:/|$)/; } /** * Returns the config for WPcom analytics. Sets various event props * used in tracking, e.g. locale, page path, etc. Mainly used for Tracks * event props. */ function getWPCOMAnalyticsDefaultConfig() { const currentGenericPageName = null; const cannonicalPath = “/support/site-verification-services/”; return { // Current page props. currentPagePath: getCurrentPagePath(), currentPageName: getCurrentPageName(), currentGenericPageName: currentGenericPageName ?? getCurrentPageName( cannonicalPath ), currentPageLocale: getCurrentPageLocale(), // Page variation props. pageVariation: ”, pagePersonalVariation: ”, // Current user props. currentUserIdHash: “”, currentUserIdHashShort: “”, currentUserEmailHash: “”, // Other misc. props. isHomepage: false, affiliateJSVersion: “1716355472”, } } // When a8c-analytics:loaded is fired, start main event handling. document.addEventListener( ‘a8c-analytics:loaded’, () => { const cb = window.a8cAnalytics.cb; const kit = window.a8cAnalytics.kit; const config = getWPCOMAnalyticsDefaultConfig(); const configOptions = window.a8cAnalyticsConfig.fireAnalyticsOptions; // Extend config with any custom props. Object.assign( window.a8cAnalyticsConfig, config ); // Backcompat. for `lpName` and `lpVariation` config properties. config.currentPageName = ! configOptions.currentPageName && ‘logged-out-homepage’ === configOptions.lpName ? configOptions.lpName : config.currentPageName; config.currentPageName = ! configOptions.currentPageName && ‘logged-out-app-promo’ === configOptions.lpName ? configOptions.lpName : config.currentPageName; // Backcompat. for `lpPersonalVariation` config property. config.pageVariation = ! configOptions.pageVariation && configOptions.lpVariation ? configOptions.lpVariation : config.pageVariation; config.pagePersonalVariation = ! configOptions.pagePersonalVariation && configOptions.lpPersonalVariation ? configOptions.lpPersonalVariation : config.pagePersonalVariation; /** * Applies linkers, e.g. for “forwarding” certain URL parameters between WordPress.com * and other properties (e.g. Jetpack.com). Used for affiliate tracking, coupons, etc. */ const applyLinkers = () => { kit.linkQueryVars( [ { includeRegExps: [ /^(?:[^/]+.)?(?:wordpress|jetpack|woocommerce|crowdsignal|wpjobmanager).com(?:/|$)/i, ], linkQueryVars: [ ‘aff’, ‘affiliate’, ‘cid’, // Aff campaign ID. ‘sid’, // Aff sub ID. ‘irclickid’ // Impact Affiliate Click ID ], }, { includeRegExps: [ /^(?:[^/]+.)?(?:wordpress|jetpack).com(?:/|$)/i, ], linkQueryVars: [ ‘coupon’, ], }, ] ); } /** * Handles currencies. Gets the currency value from cookies, and sets the currency * if the cookie is not present. Can also be overridden by setting the `currency` URL * paramter. */ const fireCurrencyHandlers = () => { let currency = kit.getQueryVar( ‘currency’ ) || ”; if ( ! currency && ‘amex-business-in’ === config.currentPageName ) { currency = ‘USD’; // Special case for this LP. } if ( currency ) { kit.docCookies.setItem( ‘landingpage_currency’, currency, 31536000, ‘/’, ‘.rootDomain’ ); } }; /** * Fires the `wpcom_page_view` Tracks event. */ const fireTracks = () => { const props = Object.assign( {}, kit.getQueryVars( ”, kit.QUERY_PARAMS ), { // Page props. path: config.currentPagePath, name: config.currentPageName, locale: config.currentPageLocale, variation: config.pageVariation, personal_variation: config.pagePersonalVariation, // Back compat. LP props. lp_name: config.currentGenericPageName, lp_variation: config.pageVariation, lp_personal_variation: config.pagePersonalVariation, } ); window._tkq.push( [ ‘recordEvent’, ‘wpcom_page_view’, props ] ); }; function fireRedditAdvertisingPixel() { !function(w,d){if(!w.rdt){var p=w.rdt=function(){p.sendEvent?p.sendEvent.apply(p,arguments):p.callQueue.push(arguments)};p.callQueue=[];var t=d.createElement(“script”);t.src=”https://www.redditstatic.com/ads/pixel.js”,t.async=!0;var s=d.getElementsByTagName(“script”)[0];s.parentNode.insertBefore(t,s)}}(window,document); rdt(‘init’,’a2_ehx23cq176s3′); rdt(‘track’, ‘PageVisit’); } /** * Handles the referral tracking. */ const fireAffiliateReferrals = () => { kit.attachScriptElement( ‘https://s1.wp.com/wp-content/themes/h4/landing/marketing/js/affiliate-referrals.js?v=’ + config.affiliateJSVersion ); }; /** * Loads the Google Ads gtag. */ const loadGoogleAdsGtag = () => { kit.loadGtag( ‘AW-946162814’ ); } /** * Loads and fires the Google Analytics 4. */ const fireGoogleAnalyticsFour = () => { const gtagOptions = { ‘anonymize_ip’: true, ‘use_amp_client_id’: true }; kit.loadGtag( ‘G-1H4VG5F5JF’, gtagOptions ); } const fireParsely = ( trackingId ) => { kit.loadParselyTracker( trackingId ); } const fireHotJar = () => { if ( ! kit.pertainsToSTS() ) { kit.fireHotjar( 227769 ); } } /** * Loads and fires the Facebook Pixel. */ const fireFacebook = () => { kit.loadFacebook(); fbq( ‘init’, ‘823166884443641’ ); fbq( ‘track’, ‘PageView’ ); } /** * Loads and fires Microsoft Clarity */ const fireMicrosoftClarity = () => { if ( window.clarity ) { return; } // Needs to be set prior to loading the external script. window.clarity = window.clarity || function () { ( window.clarity.q = window.clarity.q || [] ).push( arguments ); }; const clarityScript = kit.attachScriptElement( ‘https://www.clarity.ms/tag/j0cc1i1dba’ ); document.body.appendChild( clarityScript ); }; const fireImpactAffiliate = () => { kit.loadImpactAffiliate( config.currentUserIdHash, config.currentUserEmailHash ); } /** * Handles scroll percentage tracking. */ const trackScrollPercentage = () => { const scrollPosition = window.pageYOffset; const pageHeight = document.body.scrollHeight – window.innerHeight; const scrollProgress = ( scrollPosition / pageHeight ) * 100; // Check if the user has scrolled to 25%, 50%, 75%, or 100% of the page if ( scrollProgress >= 25 && scrollProgress = 50 && scrollProgress = 75 && scrollProgress = 100 ) { dispatchScrollCustomEvent( 100 ) } } /** * Dispatches a custom event with the scroll percentage. */ const dispatchScrollCustomEvent = ( scrollPercentage ) => { const event = new CustomEvent( `PageScrollPercentage${scrollPercentage}`, { detail: scrollPercentage } ); window.dispatchEvent(event); } /** * Handles the scroll tracking callback. E.g. firing Tracks and GA events. */ const scrollTrackingCallback = ( event ) => { const { detail: scrollPercentage } = event; const trackingProps = {}; // Event props. trackingProps.percent = event.detail ?? 0; trackingProps.path = config.currentPagePath || ”; trackingProps.name = config.currentPageName || ”; trackingProps.locale = config.currentPageLocale || ”; trackingProps.variation = config.pageVariation || ”; trackingProps.personal_variation = config.pagePersonalVariation || ”; trackingProps.lp_name = config.currentGenericPageName || ”; trackingProps.lp_variation = config.pageVariation || ”; trackingProps.lp_personal_variation = config.pagePersonalVariation || ”; tracksAnalyticsScrollEvent( trackingProps ); } /** * Dispatches a Tracks event for page scroll. */ const tracksAnalyticsScrollEvent = ( trackingProps ) => { window._tkq.push( [ ‘recordEvent’, ‘wpcom_page_scroll’, trackingProps ] ); } // Call the trackScrollProgress function every time the user scrolls window.addEventListener( ‘scroll’, trackScrollPercentage ); // Listen to events for specific scroll percentages, each event is only acted upon once. window.addEventListener( ‘PageScrollPercentage25’, scrollTrackingCallback, { once: true } ) window.addEventListener( ‘PageScrollPercentage50’, scrollTrackingCallback, { once: true } ) window.addEventListener( ‘PageScrollPercentage75’, scrollTrackingCallback, { once: true } ) window.addEventListener( ‘PageScrollPercentage100’, scrollTrackingCallback, { once: true } ) /** * Handles click tracking for certain elements in Tracks and GA. */ const setupTracksGAClickTracking = () => { document.querySelector( ‘body’ ).addEventListener( ‘click’, ( event ) => { // We only care about clicks on certain elements. if ( event.target.matches( ‘a, button, .click-tracking-enable’ ) ) { const { target: clickEventTarget } = event; // Initialize eventProps object with some defaults. const eventProps = {}; eventProps.path = config.currentPagePath || ”; eventProps.name = config.currentPageName || ”; eventProps.lp_name = config.currentGenericPageName || ”; eventProps.locale = config.currentPageLocale || ”; eventProps.variation = config.pageVariation || ”; eventProps.personal_variation = config.pagePersonalVariation || ”; // Identify farthest and closest parent element. const selectors = [ ‘.wpcom-masterbar.wpcom-header’, ‘.lp-block’, ‘.lpc’, ‘.lp-module’, ‘section’, ‘post’, ‘article’ ]; const section = getLastMatchingAncestor( event, selectors ); const container = getClosestMatchingAncestor( event, selectors ); // Get class name and ID for container and add to props. eventProps.container_id = container ? container.getAttribute( ‘id’ ) : ”; eventProps.container_class = container ? container.getAttribute( ‘class’ ) : ”; eventProps.container = eventProps.container_id || eventProps.container_class; // What type of element have we clicked? eventProps.is_cta = clickEventTarget.matches( ‘is-cta’ ) ?? false; eventProps.is_in_header_nav = clickEventTarget.classList.contains(‘x-nav-link’) || clickEventTarget.classList.contains(‘x-dropdown-link’) || clickEventTarget.classList.contains(‘x-menu-link’) || section === ‘lpc-header-nav’ || section === ‘wpcom-masterbar.wpcom-header’; const isClickedElementButton = clickEventTarget.classList.contains(‘lpc-button’) || clickEventTarget.classList.contains(‘button’) || clickEventTarget.classList.contains(‘wp-block-button__link’); const isParentElementButton = clickEventTarget.parentElement && (clickEventTarget.parentElement.classList.contains(‘lpc-button’) || clickEventTarget.parentElement.classList.contains(‘button’) || clickEventTarget.parentElement.classList.contains(‘wp-block-button__link’)); eventProps.is_button = isClickedElementButton || isParentElementButton; // Link data. eventProps.href = clickEventTarget.getAttribute( ‘href’ ) || ”; eventProps.target = clickEventTarget.getAttribute( ‘target’ ) || ”; eventProps.text = clickEventTarget.innerText || ”; eventProps.use_beacon = true; // Emit tracking event in Tracks and GA. window._tkq.push( [ ‘recordEvent’, ‘wpcom_link_click’, eventProps ] ); // TODO: Implement a click delay on navigation links and CTA buttons to improve data integrity. // if ( props.is_in_header_nav || props.is_cta || props.is_button ) { // if ( props.href && 0 !== props.href.indexOf( ‘#’ ) && -1 !== [ ”, ‘_top’, ‘_self’ ].indexOf( props.target ) ) { // event.preventDefault(); // Allow time for trackers to record the click. // setTimeout( function() { // document.location = props.href; // }, 300 ); // } // } } }); } /** * Add cookie and stats tracking for the Landpack language picker. */ const setupLocaleChangeTracking = () => { function createLocaleCookie( locale ) { const cookieDomain = ‘.wordpress.com’; const cookieName = ‘wpcom_locale’; const date = new Date(); date.setTime( date.getTime() + ( 5 * 365 * 24 * 60 * 60 * 1000 ) ); const expires = ” expires=” + date.toGMTString(); document.cookie = cookieName + ‘=’ + locale + ‘;’ + expires +’; path=/; domain=’ + cookieDomain; } function createStatsRequest( locale, href ) { const languageChangeStat = new Image(); languageChangeStat.onload = () => window.location.href = href; languageChangeStat.onerror = languageChangeStat.onload; languageChangeStat.src = ‘https://pixel.wp.com/g.gif?v=wpcom-no-pv&x_language-switcher=manual-switch-‘ + locale + ‘&rm=’ + Math.random(); } document.body.addEventListener( ‘click’, ( event ) => { const { target } = event; if ( target.matches( ‘.lp-language-picker a[lang]’ ) ) { event.preventDefault(); const code = target.getAttribute( ‘lang’ ); const href = target.getAttribute( ‘href’ ); createLocaleCookie( code ); createStatsRequest( code, href ); } }); } /** * Loads and fires the Bing tracking pixel. */ const fireBing = () => { ( function( w, d, t, r, u ) { var f, n, i; w[ u ] = w[ u ] || [], f = function() { var o = { ti: “4074038” }; o.q = w[ u ], w[ u ] = new UET( o ), w[ u ].push( “pageLoad” ) }, n = d.createElement( t ), n.src = r, n.async = 1, n.onload = n.onreadystatechange = function() { var s = this.readyState; s && s !== “loaded” && s !== “complete” || ( f(), n.onload = n.onreadystatechange = null ) }, i = d.getElementsByTagName( t )[ 0 ], i.parentNode.insertBefore( n, i ) } )( window, document, “script”, “//bat.bing.com/bat.js”, “uetq” ); } /** * Adds a click event for Facebook pixel tracking on the /webinar sub pages. */ const trackFacebookWebinarClicks = () => { const facebookPixelURL = ‘https://www.facebook.com/tr?id=759053181468957&ev=SubscribedButtonClick&noscript=1’; const elementsToTrack = document.getElementsByClassName( ‘webinar-facebook-click-track’ ); const handleFacebookClickEvent = ( event ) => { const facebookImgPixel = document.createElement( ‘img’ ); facebookImgPixel.width = 1; facebookImgPixel.height = 1; facebookImgPixel.src = facebookPixelURL; document.body.appendChild( facebookImgPixel ); } Array.from( elementsToTrack ).forEach( ( element ) => element.addEventListener( ‘click’, handleFacebookClickEvent )); } // Apply the URL parameter linkers. applyLinkers(); // Add “essential” trackers to queue. cb.addTracker( ‘essential’, false, fireCurrencyHandlers ); // Add “analytics” trackers to queue. cb.addTracker( ‘analytics’, false, fireTracks ); cb.addTracker( ‘analytics’, false, fireAffiliateReferrals ); cb.addTracker( ‘analytics’, false, setupTracksGAClickTracking ); cb.addTracker( ‘analytics’, false, trackScrollPercentage ); cb.addTracker( ‘analytics’, false, setupLocaleChangeTracking ); cb.addTracker( ‘analytics’, true, fireGoogleAnalyticsFour ); cb.addTracker( ‘analytics’, true, () => fireParsely( ‘wordpress.com’ ) ); // Add “advertising” trackers to queue. cb.addTracker( ‘advertising’, true, loadGoogleAdsGtag ); cb.addTracker( ‘advertising’, true, fireFacebook ); cb.addTracker( ‘advertising’, true, trackFacebookWebinarClicks ); cb.addTracker( ‘advertising’, true, fireBing ); cb.addTracker( ‘advertising’, true, fireRedditAdvertisingPixel); // cb.addTracker( ‘advertising’, true, fireHotJar ); – Disabling for now. Enable when Hotjar is required to be used. // cb.addTracker( ‘advertising’, true, fireMicrosoftClarity ); – Disabling for now. cb.addTracker( ‘advertising’, true, fireImpactAffiliate ); // Maybe fire trackers now, via cookie banner, based on bucketed consent. cb.maybeFireTrackers(); }); }; // CCPA – Do Not Sell My Data. document.addEventListener( ‘a8c-analytics:loaded-is-ccpa’, ( event ) => { const { detail } = event; const isCCPAEligible = JSON.parse( detail ).isCCPA; if ( ! isCCPAEligible ) { document.querySelectorAll( ‘[data-is-ccpa-dnsd]’ ).forEach( ( element ) => { const parent = element.parentNode; const parentTagName = parent.tagName.toLowerCase(); // If the link in a part of a list, remove the entire parent item. // Otherwise, remove only the link element. ( parentTagName === ‘li’ ? parent : element ).remove(); } ); return; } document.querySelector( ‘[data-is-ccpa-dnsd-trigger]’ ).onclick = ( event ) => { event.preventDefault(); window.a8cAnalytics.dnsd.show(); }; } ); if ( window.defQueue && defQueue.isLOHP && defQueue.isLOHP === 2020 ) { defQueue.items.push( setupAnalytics ); } else { setupAnalytics(); } } )(); ]]>
{ fetchExternalScript(‘verbum’); promises[‘verbum’] = promises[‘verbum’] || loadWPScript(‘verbum’); return promises[‘verbum’]; }, }; const scriptExtras = { }; window.WP_Enqueue_Dynamic_Script = { loadScript: (handle) => { if (!loaders[handle]) { console.error(‘WP_Enqueue_Dynamic_Script: unregistered script `’ + handle + ‘`.’); } return loaders[handle](); } }; function fetchExternalScript(handle) { if (!urls[handle]) { return Promise.resolve(); } fetches[handle] = fetches[handle] || fetch(urls[handle], { mode: ‘no-cors’ }); return fetches[handle]; } function runExtraScript(handle, type, index) { const id = ‘wp-enqueue-dynamic-script:’ + handle + ‘:’ + type + ‘:’ + (index + 1); const template = document.getElementById(id); if (!template) { return Promise.reject(); } const script = document.createElement( ‘script’ ); script.innerHTML = template.innerHTML; document.body.appendChild( script ); return Promise.resolve(); } function loadExternalScript(handle) { if (!urls[handle]) { return Promise.resolve(); } return fetches[handle].then(() => { return new Promise((resolve, reject) => { const script = document.createElement(‘script’); script.onload = () => resolve(); script.onerror = (e) => reject(e); script.src = urls[handle]; document.body.appendChild(script); }); }); } function loadExtra(handle, pos) { const count = (scriptExtras[handle] && scriptExtras[handle][pos]) || 0; let promise = Promise.resolve(); for (let i = 0; i runExtraScript(handle, pos, i)); } return promise; } function loadWPScript(handle) { // Core loads scripts in this order. See: https://github.com/WordPress/WordPress/blob/a59eb9d39c4fcba834b70c9e8dfd64feeec10ba6/wp-includes/class-wp-scripts.php#L428. return loadExtra(handle, ‘translations’) .then(() => loadExtra(handle, ‘before’)) .then(() => loadExternalScript(handle)) .then(() => loadExtra(handle, ‘after’)); } } )(); ]]>