function my_amp_scripts( $data ) { $data['amp_component_scripts'] = array( 'amp-analytics' => 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js' ); return $data; } add_filter( 'amp_post_template_data', 'my_amp_scripts' ); function my_amp_analytics( $amp_template ) { ?> /* */