function google_analytics_counter_page_attachments in Google Analytics Counter 8.3
Implements hook_page_attachments().
File
- ./
google_analytics_counter.module, line 119 - Basic functions for this module.
Code
function google_analytics_counter_page_attachments(&$page) {
$theme = \Drupal::theme()
->getActiveTheme()
->getName();
if (in_array($theme, [
'bartik',
'seven',
])) {
$page['#attached']['library'][] = 'google_analytics_counter/google_analytics_counter';
}
}