Skip to content

Instantly share code, notes, and snippets.

@kjy112
Created February 24, 2016 23:31
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 kjy112/867a39d3aab808026d56 to your computer and use it in GitHub Desktop.
Save kjy112/867a39d3aab808026d56 to your computer and use it in GitHub Desktop.
Add Analytics Script to Head
<?php
/*
* Adding Google Analytics AMP Head
*/
add_action('amp_post_template_head', 'xyz_amp_google_analytics_head');
function xyz_amp_google_analytics_head(){
?>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<?php
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment