### Initialize Google Analytics with environment check Source: https://github.com/andreasbm/web-skills/blob/master/index.html Configures the gtag function to log events to the console instead of sending them to Google Analytics when running on non-production domains. ```javascript window.dataLayer = window.dataLayer || []; // Disable GA on dev const disableGtag = !(location.hostname === `andreasbm.github.io` || location.hostname === `webskills.dev`); if (disableGtag) { window["ga-disable-UA-96179028-7"] = true; } // Setup gtag window.gtag = function () { if (disableGtag) { console.log("Track", arguments); } else { dataLayer.push(arguments); } }; gtag("js", new Date()); gtag("config", "UA-96179028-7", {"send_page_view": false}); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.