I don’t understand how custom variables work for user login.
I’ve got below code:
_gaq.push(['_setCustomVar',
1, // This custom var is set to slot #1. Required parameter.
'User Type', // The name of the custom variable. Required parameter.
'{$smarty.get.user_group_id}', // Sets the value of "User Type" to "Member" or "Visitor" depending on status. Required parameter.
2 // Sets the scope to session-level. Optional parameter.
]);
_gaq.push(['_trackPageview', '/subscribe-successful']);
Google Analytics code appears before this code.
After user logs in, it displays this code which is fine but does the code have to appear on every other pages after that or can it just display once then would GA track the rest?
You can call it once and it will impact the entire user session : that’s why the scope variable is set to 2 == session level.