You are here

function uc_googleanalytics_install in Ubercart 8.4

Implements hook_install().

File

uc_googleanalytics/uc_googleanalytics.install, line 11
Install, update and uninstall functions for the uc_googleanalytics module.

Code

function uc_googleanalytics_install() {

  // Get the weight of the Google Analytics module.
  $weight = \Drupal::configFactory()
    ->get('core.extension')
    ->get('module.google_analytics');

  // Update the weight of the UC Google Analytics module so its hooks get called
  // after the actual Google Analytics module.
  \Drupal::configFactory()
    ->getEditable('core.extension')
    ->set('module.uc_googleanalytics', $weight + 1)
    ->save();
}