Skip to content
Snippets Groups Projects
Commit e1f490f2 authored by Erick Hitter's avatar Erick Hitter
Browse files

Better building of settings output, also giving others all the freedom they...

Better building of settings output, also giving others all the freedom they need to add per the spec
parent 3e168622
Branches
No related tags found
1 merge request!1WIP: Initial release
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -108,25 +108,23 @@ class ETH_AMP_Analytics_WP {
*
*/
public function action_amp_post_template_footer( $amp_template ) {
$triggers = array(
'trackPageview' => array(
'on' => 'visible',
'request' => 'pageview',
$output = array(
'vars' => array(
'account' => $this->get_option( 'property_id' ),
),
'triggers' => array(
'trackPageview' => array(
'on' => 'visible',
'request' => 'pageview',
),
),
);
$triggers = apply_filters( 'eth_amp_analytics_wp_ga_triggers', $triggers, $amp_template );
$output = apply_filters( 'eth_amp_analytics_wp_ga_settings_js', $output );
?>
<amp-analytics type="googleanalytics" id="analytics1">
<script type="application/json">
{
"vars": {
"account": "<?php echo esc_js( $this->options['property_id'] ); ?>"
},
"triggers": <?php wp_json_encode( $triggers ); ?>
}
</script>
<script type="application/json"><?php echo wp_json_encode( $output ); ?></script>
</amp-analytics>
<?php
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment