Skip to content

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' }
  ]
})