Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
- _gaq.push(['_setDomainName', 'XXXXXXXXXXXX.com']);
- // Get Username, try from session cookie first
- var savedName = $.cookie("svName");
- if ((savedName==null)||(savedName==""))
- {
- savedName = $().SPServices.SPGetCurrentUser({fieldName: "Name",async:false,debug: false);
- $.cookie("svName",savedName, { path: '/' });
- }
- // Set Google Analytics Custom Var
- _gaq.push(['_deleteCustomVar', 1]);
- _gaq.push(['_setCustomVar',
- 1, // This custom var is set to slot #1. Required parameter.
- 'SPUser', // The top-level name for your online content categories. Required parameter.
- savedName,3 // Sets the value of "SPUser" Required parameter.
- ]);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement