Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Latest commit

 

History

History
28 lines (21 loc) · 575 Bytes

set.md

File metadata and controls

28 lines (21 loc) · 575 Bytes

Set

Sets a single field and value pair or a group of field/value pairs on a tracker object.

this.$ga.set(fieldName, fieldValue)

also possible to pass an object literal

this.$ga.set({ fieldName: fieldValue })

Set multiple fields before first hit

Adding the set property to the configuration object, we can set multiple fields automatically before the first hit

import Vue from 'vue'
import VueAnalytics from 'vue-analytics'

Vue.use(VueAnalytics, {
  id: 'UA-XXX-X',
  set: [
    { field: 'fieldname', value: 'fieldvalue' }
  ]
})