You are here

public function ContainerManager::getNoScriptAttachments in GoogleTagManager 8

Adds render array items of page top attachments.

Parameters

array $page: The page render array.

Overrides ContainerManagerInterface::getNoScriptAttachments

File

src/Entity/ContainerManager.php, line 206

Class

ContainerManager
Defines the Google tag container manager.

Namespace

Drupal\google_tag\Entity

Code

public function getNoScriptAttachments(array &$page) {
  $ids = $this
    ->loadContainerIDs();
  $containers = $this->entityTypeManager
    ->getStorage('google_tag_container')
    ->loadMultiple($ids);
  foreach ($containers as $container) {
    if (!$container
      ->insertSnippet()) {
      continue;
    }
    $page += $container
      ->noscriptTag();
  }
}