You are here

function _ga_copy_gacsp_config in Googalytics - Google Analytics 8

Copy config from gacsp if available.

1 call to _ga_copy_gacsp_config()
ga_install in ./ga.install
Implements hook_install().

File

./ga.install, line 38
Contains ga module installation and update hooks.

Code

function _ga_copy_gacsp_config() {
  $gacspConfig = \Drupal::configFactory()
    ->getEditable('gacsp.settings')
    ->getRawData();
  if (!empty($gacspConfig)) {
    \Drupal::configFactory()
      ->getEditable('ga.settings')
      ->setData($gacspConfig)
      ->set('premium', FALSE)
      ->set('sample_rate', 100)
      ->set('site_speed_sample_rate', 1)
      ->set('force_ssl', FALSE)
      ->save();
  }
}