+ Start a Discussion

Customer Portal Content Download Tracking and/or ClickTracking

Hey Everyone,


I'm working on a pretty insane project right now that has a very cool requirement. Basically, we're building a very content rich customer portal. For every user of the portal, we need to track exactly what Salesforce content they downloaded, links clicked on etc.


I don't believe Salesforce content API exposes downloads outside of internal Salesforce users so I was considering building a click tracking module for my customer portal. If I'm going to do this, now I need a place to store all the data that we're capturing from customer portal sessions. A few options I'm considering:


A. Salesforce.com record for every click/download/etc - While this will be the easiest to write the reports the client wants, I'm hosed on data storage as the site has potentially thousands of users clicking everywhere.


B. Create one salesforce.com record per authenticated session and store all of the clicks in a comma separated text area long field.


C. Setup a MYSQL database over on AWS and capture this data here. I'll have to then write my consumption reports by looking at AWS and SFDC but the store capacity is far greater than what we have at Salesforce.


If anyone has ever built something like this before or has any suggestions on how to proceed, please do let me know.




Is something like Google Analytics out of the question?  They support more than just page-load tracking.  Most people don't go this far, but you can track custom events (like specific links being clicked for JS/AJAX actions) as well.


Google Analytics won't work for this. There are many reasons but the most important being the app works via cookie. I need a solid way to track content downloads and tie them back to the username who downloaded the conent.  Any other ideas?


Rich - Its always a challenge to make SFDC do something that its not really meant to do.  My first question is whether a (native) SFDC solution is really best approach.  If you are forced to consider AWS and a hosted MySQL server you are already breaking outside of the mold of what was intended.  I wonder if a solution like Drupal that potentially syncs to SFDC content hosted on AWS might be a better fit? Also you want to be super careful about fully considering the total costs of ownership on AWS.


Assuming that this is not the answer I have a hack that might work. Would it work to setup an Apache Web Server that just listens for clicks?  Basically serve a 1X1 pixel on every page but pass through query strings on each request.  If properly configured the web logs will record every request and then you can use a tool like AWStats to analyze / report on the logs. 


Finally its possible that PivotLink might have something that you could use. 






Have you considered maybe using a force.com free org and set up an integration via Apex web services or some SFDC to SFDC to store the tracking data?


I think what I'm planning on doing is setting up a javascript wrapper that sends all clicks to an APEX class. The APEX class will be programmed to look for only certain type of content clicks. I don't think they'll be too many clicks on the specific content we're looking to track so I think I'll be safe on data storage. Worst case, user upgrades to Unlimited!


Let me know if you think of anything else.

Revathy PrasanthRevathy Prasanth



I have a similar requirement to Download Content from a VF page, but not in using Sites. Is there any API which I can use for the Content Download in Apex class?


Thanks in advance,