public static function AmpAnalytics::preRenderAnalytics in Accelerated Mobile Pages (AMP) 8.3
Same name and namespace in other branches
- 8 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::preRenderAnalytics()
- 8.2 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::preRenderAnalytics()
Pre-render callback: Attaches the amp-analytics library.
File
- src/
Element/ AmpAnalytics.php, line 43
Class
- AmpAnalytics
- Provides a render element for amp-analytics.
Namespace
Drupal\amp\ElementCode
public static function preRenderAnalytics($element) {
$element['#attached']['library'][] = 'amp/amp.analytics';
return $element;
}