amp-8.x-3.5/templates/amp-analytics.html.twig
templates/amp-analytics.html.twig
{#
/**
* @file
* Template for amp-analytics.
*
* Available variables:
* - account: The analytics account ID.
* - attributes: The HTML attributes for amp-analytics, primarily:
* - type: The type of analytics account.
*
* @see template_preprocess_amp_iframe()
*/
#}
<amp-analytics{{ attributes }}>
{% if account %}
<script type="application/json">
{
"vars": {
"account": "{{ account }}"
},
"triggers": {
"trackAmpview": {
"on": "visible",
"request": "pageview"
}
}
}
</script>
{% endif %}
</amp-analytics>
