amp-analytics.html.twig in Accelerated Mobile Pages (AMP) 8.2
Same filename and directory in other branches
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 also
template_preprocess_amp_iframe()
1 theme call to amp-analytics.html.twig
- AmpAnalytics::getInfo in src/
Element/ AmpAnalytics.php - Returns the element properties for this element.
File
templates/amp-analytics.html.twigView source
- {#
- /**
- * @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 }}>
- <script type="application/json">
- {
- "vars": {
- "account": "{{ account }}"
- },
- "triggers": {
- "trackAmpview": {
- "on": "visible",
- "request": "pageview"
- }
- }
- }
- </script>
- </amp-analytics>