Sha256: fa942c709940ffef314c9f63ae27514f7513962401cd3afb32b3ebc2afbaa947

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

/* eslint-env */

// This adds in javascript that initialises components and dependencies
// that are provided by Slimmer in public frontend applications.
// = require ./modules.js
// = require ./single-consent-functions.js

document.addEventListener('DOMContentLoaded', function () {
  window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
  window.GOVUK.analyticsVars = window.GOVUK.analyticsVars || {}

  // if statements ensure these functions don't execute during testing
  if (typeof window.GOVUK.loadAnalytics !== 'undefined') {
    window.GOVUK.loadAnalytics.loadExtraDomains()
    if (typeof window.GOVUK.analyticsGa4.vars === 'undefined') {
      window.GOVUK.loadAnalytics.loadGa4()
    }
    if (typeof window.GOVUK.analyticsVars.gaProperty === 'undefined') {
      window.GOVUK.loadAnalytics.loadUa()
    }
  }

  window.GOVUK.modules.start()
})

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_publishing_components-37.7.1 app/assets/javascripts/govuk_publishing_components/dependencies.js