Google analytics custom variables 笔记
Custom variable:
- Is a name-value pair
- Custom variables can help to define additional segments
- There are 3 levels in GA's visitor interaction model
- visitor
- session
- page
- _setCustomVar(index, name, value, opt_scope)
- index - slot 1 to 5, required
- opt_scope - 1,2,3 default to page scope 3
- You can _deleteCustomVar(index) to remove a CV
- Call _setCustomVar() before pageView or event
Page level:
- A single pageView, event, or transaction call
- Variable slots can be reused on one page, but only the last one will apply in that case
- For any single page, only up to 5 CV can be used
Session level:
- Apply to the current session - decided by cookies
- Last set value in the session scope CV win
- If use the same slot, session scoped CV will override page scoped CV(see note 1)
- For any given session, up to 5 CV can be used
Visitor level:
- Current and future session for the lift of visitor cookies
- Last set value in the last session win
- Up to 5
Note 1: When use same slot number for page and session CV, the page level CV will not be recorded.
Note 2: Visitor level CV does not override page level CV.
评论
发表评论