Sha256: de45fddb8f8c62157bbd5943d38cf02dca042aa0bd80d97dc493679fdf04e6f3

Contents?: true

Size: 792 Bytes

Versions: 9

Compression:

Stored size: 792 Bytes

Contents

window.GOVUK = window.GOVUK || {}
window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {}
window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analyticsModules || {};

(function (analyticsModules) {
  'use strict'

  var Ga4PrintIntentTracker = {
    init: function () {
      window.addEventListener('beforeprint', function () {
        var data = {
          event_name: 'print_page',
          type: 'print page',
          method: 'browser print'
        }
        var schema = new window.GOVUK.analyticsGa4.Schemas()
        schema = schema.mergeProperties(data, 'event_data')
        window.GOVUK.analyticsGa4.core.sendData(schema)
      })
    }
  }

  analyticsModules.Ga4PrintIntentTracker = Ga4PrintIntentTracker
})(window.GOVUK.analyticsGa4.analyticsModules)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
govuk_publishing_components-35.23.0 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.22.0 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.21.4 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.21.3 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.21.2 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.21.1 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.21.0 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.20.1 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js
govuk_publishing_components-35.20.0 app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-print-intent-tracker.js