We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
it's time to move the GA snippet from html5 boilerplate to soil
lib/config.php
if (!defined('GOOGLE_ANALYTICS_ID')) { // Format: UA-XXXXX-Y (Note: Universal Analytics only) define('GOOGLE_ANALYTICS_ID', ''); }
lib/assets.php
/** * Google Analytics snippet from HTML5 Boilerplate * * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM */ function google_analytics() { ?> <script> <?php if (WP_ENV === 'production' && !current_user_can('manage_options')) : ?> (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='//www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); <?php else : ?> function ga() { if (window.console) { console.log('Google Analytics: ' + [].slice.call(arguments)); } } <?php endif; ?> ga('create','<?= GOOGLE_ANALYTICS_ID; ?>','auto');ga('send','pageview'); </script> <?php } if (GOOGLE_ANALYTICS_ID) { add_action('wp_footer', __NAMESPACE__ . '\\google_analytics', 20); }
The text was updated successfully, but these errors were encountered:
closed by #1382 and roots/soil#56
Sorry, something went wrong.
No branches or pull requests
it's time to move the GA snippet from html5 boilerplate to soil
lib/config.php
lib/assets.php
The text was updated successfully, but these errors were encountered: