Skip to content

Instantly share code, notes, and snippets.

@swissspidy
Created July 26, 2021 08:56
Show Gist options
  • Save swissspidy/1dd9edce91c1135efee9f8c4ef35d17f to your computer and use it in GitHub Desktop.
Save swissspidy/1dd9edce91c1135efee9f8c4ef35d17f to your computer and use it in GitHub Desktop.
Sample integration of Alexa Certify analytics code with the Web Stories WordPress plugin.
<?php
/**
* Plugin Name: Web Stories Alexa Certify
* Description: Sample integration of Alexa Certify 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="alexametrics">
<script type="application/json"> {
"vars": {
"atrk_acct": "SafIt1WyR820WR",
"domain": "XXXXX.com"
}
}</script>
</amp-analytics>
<?php
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment