Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created May 6, 2020 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcauley/308c7d7758ef7b640abb33f6eaaac92c to your computer and use it in GitHub Desktop.
Save jdcauley/308c7d7758ef7b640abb33f6eaaac92c to your computer and use it in GitHub Desktop.
<script>
<?php if ( $google_analytics_delay ) { ?>
setTimeout(function(){
<?php } ?>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '<?php echo esc_js( self::$ga_id ); ?>');
<?php if ( $google_analytics_delay ) { ?>
}, 3000);
<?php } ?>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment