• Hi!

    Just to let you know there is support in the plugin sponsored by Automattic, hooking your function into the filter amp_post_template_analytics:

    I’ve implemented it with this function in my theme:

    
    add_filter('amp_post_template_analytics', function() {
    $data = ['pageview1' => [
        'type' => 'googleanalytics',
        'attributes' => [],
        'config_data' => [
            'vars' => ['account' => get_option('theme_google_ua') ],
            'triggers' => [
               'trackPageview' => ['on' => 'visible', 'request' => 'pageview']
            ],
        ],
    ]];
    return $data;
    });
    

    It allows more easily add customizations like events and social interactions. Maybe it would be nice this plugin will help people to add custom configs for this, just hooking in the filter provided.

  • The topic ‘Support for analytics in official Automattic plugin’ is closed to new replies.