Last active
December 3, 2021 13:39
-
-
Save swissspidy/bdd58b2de495d5a691d015eb67736775 to your computer and use it in GitHub Desktop.
Sample integration of Parse.ly analytics code with the Web Stories WordPress plugin.
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 | |
/** | |
* Plugin Name: Web Stories Parse.ly Analytics | |
* Description: Sample integration of Parse.ly analytics code with the Web Stories WordPress plugin. | |
* Plugin URI: https://wp.stories.google/ | |
* Author: Pascal Birchler, Google | |
* Author URI: https://opensource.google.com/ | |
* Version: 0.0.1 | |
* License: Apache License 2.0 | |
* License URI: https://www.apache.org/licenses/LICENSE-2.0 | |
*/ | |
add_action( | |
'web_stories_print_analytics', | |
static function () { | |
?> | |
<amp-analytics type="parsely"> | |
<script type="application/json"> | |
{ | |
"vars": { | |
"apikey": "YOUR Site ID (apikey) GOES HERE" | |
} | |
} | |
</script> | |
</amp-analytics> | |
<?php | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment