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' }
]
})
当前内容版权归 vue-analytics 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 vue-analytics .