amp_post_template_analytics

apply_filters( 'amp_post_template_analytics',  array $analytics,  WP_Post $post )

Description #

Add amp-analytics tags.

This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting. This filter should be used to alter entries for legacy AMP templates.


Parameters #

$analytics

(array) An associative array of the analytics entries we want to output. Each array entry must have a unique key, and the value should be an array with the following keys: `type`, `attributes`, `script_data`. See readme for more details.

$post

(WP_Post) The current post.



Changelog #

Changelog
Version Description
0.4 Introduced.