function _google_tag_variable_clean in GoogleTagManager 7
Returns a cleansed variable.
Parameters
string $variable: The variable name.
string $default: The default value for the variable.
Return value
string The cleansed variable.
4 calls to _google_tag_variable_clean()
- _google_tag_data_layer_snippet in includes/
snippet.inc - Returns JavaScript data layer snippet or adds items to data layer.
- _google_tag_environment_query in includes/
snippet.inc - Returns a query string with the environment parameters.
- _google_tag_noscript_snippet in includes/
snippet.inc - Returns JavaScript noscript snippet.
- _google_tag_script_snippet in includes/
snippet.inc - Returns JavaScript script snippet.
File
- includes/
snippet.inc, line 157 - Contains the JavaScript snippet insertion code.
Code
function _google_tag_variable_clean($variable, $default = '') {
return trim(drupal_json_encode(variable_get($variable, $default)), '"');
}