To run analytics javascript on every salesforce page I want to insert Javascript in every page.
So far I read about a couple of different methods:
home page component
- a HTML Home page component (need to customize UI to show the components on every page)
- limitations: does not work for Chatter, Reports and Setup
- possible issue: these comments indicate problems with ‘winter 13’
Custom Button with Javascript
- (don’t know much about this yet) sound like one has to create/assign the buttons to object-types)
Custom APEX controller?
How would this work?
Visualforce page ??
How would this work?
To my understanding it would be possible to replace everything with visualforce pages, but this is obviously not very elegant/maintainable.
I’m curious to see what other methods there are, in partciular by modifying the controller?
What other things to consider (downsides, risks) with the presented methods?
Sidebar component sounds best suited for that to be honest.
Any button/link you’ll add to object detail pages will both require clicking on it(!) and won’t work on “tab view”, “new record” or “edit” pages. You could override most of them with VF pages but that’s A LOT of work and there’s no way you’ll be able to customize UI of these special places: Chatter, Console tab, Reports,Dashboard.
I’m not sure what do you mean by “modifying the controller”, there’s no such global thing you’d have access to.
There’s option of embedding a small VF page into page layout of every detail page but it’s equally limited in terms of maintenance and not being present on the new/edit pages.
There are better analytics options for Force.com Sites (not the least of them being the
<site:googleAnalyticsTracking/>tag). You should also receive a monthly newsletter (typically with 2-3 month’s delay) summarizing usage of your Salesforce instance, user adoption, areas to explore etc. If you don’t – check your User’s “receive salesforce newsletter” etc settings.