function google_optimize_container_ids in Google Optimize 8
The Optimize container ids.
Return value
array google_optimize_container_ids
See also
https://developers.google.com/optimize/#loading_multiple_containers
3 calls to google_optimize_container_ids()
- GoogleOptimizeAdminSettingsForm::buildForm in src/
Form/ GoogleOptimizeAdminSettingsForm.php - Form constructor.
- google_optimize_hide_page_active in ./
google_optimize.module - Whether to put the snippet on the page.
- google_optimize_page_attachments in ./
google_optimize.module - Implements hook_page_attachments().
File
- ./
google_optimize.module, line 45 - google_optimize.module
Code
function google_optimize_container_ids() {
static $ids;
if (!is_null($ids)) {
return $ids;
}
$config = \Drupal::config('google_optimize.settings');
$csv = $config
->get('container_ids') ?: '';
if (empty($csv)) {
$ids = [];
}
else {
$ids = str_getcsv($csv);
}
return $ids;
}