function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RichSpitzRichSpitz 

Adding ClientID to WebAnalytics for Google Analytics

First, I am not a developer, so please have some patience. Here's what I need help with. 
My objective is to report on Salesforce User Activities and PageViews inside of Google Analytics.

I downloaded the WebAnalytics addon from the Appexchange https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016cuSEAQ
and got it installed and working. I realize that this uses S Controls which are no longer supported, but they still work. 
I am able to track usage but all the data is showing by Client ID.
User-added image

What I would like to do is convert this to a Salesforce User. I am only tracking 12 sales reps, so I would be open to some way to substitute the Client ID for the Username. The other option is to add some code to the script to capture the user name. 
I am already capturing the "transactions" with this line
var pageTracker = _gat._getTracker("UA-8953xxxx-1");

so I need to create another line of code that's something like:
ClientID = User First Name + User Last Name

I don't know javascript, so if someone could just give me the correct syntax, that would be much appreciated.
Thanks in advance
David CDavid C
You would need to first create a user view in Google Analytics and in the code that you embed you need to send the user id you have in your system back to Google Analytics. You could get a callback from Salesforce after a user fills out a web to lead form and send that id back to Google Analytics.

One thing to note however is that Google Analytics doesn't allow personally identifiable data to be sent so sending usernames would be problematic. Check out this guide to integrating Google Analytics with Salesforce (https://attribut.io/blog/2018/11/21/the-ultimate-guide-to-measure-roi-on-your-direct-marketing-efforts-with-salesforce-and-google-analytics-1/), if you need further technical details.