You are here

public function Container::variableClean in GoogleTagManager 8

Returns a cleansed variable.

Parameters

string $variable: The variable name.

Return value

string The cleansed variable.

4 calls to Container::variableClean()
Container::dataLayerSnippet in src/Entity/Container.php
Returns JavaScript data layer snippet or adds items to data layer.
Container::environmentQuery in src/Entity/Container.php
Returns a query string with the environment parameters.
Container::noscriptSnippet in src/Entity/Container.php
Returns JavaScript noscript snippet.
Container::scriptSnippet in src/Entity/Container.php
Returns JavaScript script snippet.

File

src/Entity/Container.php, line 365

Class

Container
Defines the container configuration entity.

Namespace

Drupal\google_tag\Entity

Code

public function variableClean($variable) {
  return trim(json_encode($this
    ->get($variable)), '"');
}