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

Latest commit

 

History

History
34 lines (29 loc) · 565 Bytes

fields.md

File metadata and controls

34 lines (29 loc) · 565 Bytes

Tracker fields

It is possible to setup initial tracker fields using the fields prop

Vue.use(VueAnalytics, {
  id: 'UA-XXX-X',
  fields: {
    userId: 'xxx'
  }
})

It's also possible to add fields per id

Vue.use(VueAnalytics, {
  id: ['UA-12345-1', 'UA-54321-2'],
  //fields for both IDS
  fields: {
    userId: '1',
  },
  customIdFields: {
    'UA-12345-1': {
      clientId: '2'
    },
    'UA-54321-2': {
      clientId: '3'
    }
  }
})

it is also possible to set fields in runtime using the set method