Created
February 24, 2016 23:31
-
-
Save kjy112/867a39d3aab808026d56 to your computer and use it in GitHub Desktop.
Add Analytics Script to Head
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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