27 October 2014

Tracking User Activity Across Browsers and Mobile Devices

I'm often asked whether we can track user activity at a more granular level than what's currently provided with Login History, Setup Audit Trail, and other existing monitoring features in Salesforce.

When I tell them yes, people's imaginations immediate kick into over-drive. Without understanding what is possible, people begin to imagine every possible way data can be accessed whether through a button click, running a report, viewing a list view, hovering over a related list, or looking at search results.

There are many ways users may interact with data in Salesforce. This blog post is designed to separate out fact from fiction when understanding how granular we can track user activity while working with the new Event Log Files functionality.

Event Log Files provides self-service access for customers to server generated log records. This means that a server interaction had to happen in order to record the event. The most typical server interaction is the change in a URI (uniform resource identifier, analogous to the URL you see in your address bar).


For example, when I clicked on the Marc Benioff contact record from the Home tab, the URL in the address bar changed by adding the contact id. As a result, the entry in the log file shows a Referrer URI of /home/home.jsp and a URI of /0033000000Vt4Od.

This URI interaction unto itself is powerful considering salesforce grew up as a native web application. Most things that we click ultimately change the URI. The easiest way to test this is to click something in the application and see if the address bar changes.

De-coding the URIs isn't difficult, it just takes a lexicon:
Standard object based pages:

/d: Detail- Detailing a single record and with its associated records
/m: Hover- HoverDetail page that uses a mini layout and no header/footer
/e: editPage Allowing the editing of a single record
/p: printableView- In a relatively unadorned format, detailing a single record and all of its associated records.
/o: Overview of a single entity.
/l: list- A filtered list of a single entity
/x: Printable list: A filtered list of a single entity. Does not have a help link, since you can't click links on paper.
/r: Refresh list: A stripped down version of a list filtered by ids
/s: special: Special is used for "other" pages where you want to reuse parts of the edit/detail page
/h: history: Show the history (used only in forecasting)
/a: Assign: Entity Owner Change page
/c: calendar: Time-based (Calendar) view of list data
/n: mini edit: Mini layout edit page

Custom Objects based Pages

/d: Detail
/m: Hover
/e: Edit
/p: Printable View
/o: Overview
/l: List
/x: Printable List
/a: Assign
/r: Refresh List

We can now track when someone prints a page or list view, edits a record or creates one, changes ownership, or even refreshes a list.

URI events mainly track what happens in the browser. In order to track similar interactions on a mobile device using a Salesforce 1 application, we have a separate UI Tracking log event.

At Dreamforce 2014's True to the Core session Mark Bruso asked me about this distinction and what we actually track.

Most of the time, when people ask about Salesforce 1 mobile, it's to validate the effectiveness of a BYOD (Bring Your Own Device) mobile strategy with a focus on the type of device, network used, and operating system of choice. The goal is typically to rationalize an investment in mobile in addition to understanding what their users are doing when they are in a Salesforce 1 application.


However, we also track a couple key attributes in the UI Tracking log file including Referrer and Action. This are analogous to the URI and Referrer URI attributes in the URI log file.

When you combine these two data sets, the big picture emerges across these different platforms. Now we can track what's happening with a user regardless of whether they use a browser or a mobile phone.


This is powerful for answering questions like:
  1. What % of my users are in the browser versus on the phone?
  2. Where are users using their mobile devices since they may be on the road?
  3. Where are my users spending their time and on what records?
  4. How frequently are they logging in and what hours of the day?
  5. Who clicked on what, when, where, and how?
Tracking user activity in salesforce isn't rocket surgery. We can't track everything a client side script might, but we can track a lot. And what we track enables us to re-create what a user did and paint a picture that helps address a variety of adoption, troubleshooting, and audit use cases.

20 October 2014

Salesforce Application Monitoring with Event Log Files



Have you ever:
  • wondered how to make your sales and support reps more successful?
  • wanted to track the adoption of projects that you roll out on the Salesforce platform like S1, Chatter, or the Clone This User app from Arkus?
  • wanted to find out which apex classes are succeeding and how long it takes for your Visualforce pages to render in production?
  • find out why some reports run slower than others?
  • needed to audit when ex-employees leave the company with your customer list?
Application Monitoring using Event Log Files, new in the Winter '15 release, enables all of these use cases and many, many more using an easy to download, file based API to extract Salesforce app log data.

When we started building this feature, which has been in pilot for over a year, we talked with a lot of customers who wanted access to our server logs for a variety of use cases.

What we heard from many of those customers was that they wanted to easily integrate the log data from all of their organizations with their back-end reporting and audit systems so they could drill down into the day-to-day detail. As a result, you won't find a user interface within setup to access these files; everything is done through the API in order to make integration easy.

The idea behind this feature is simple. Everyday, Salesforce generates a massive amount of app log data on our servers.

Our app logs do not contain customer data but instead contain metadata about the events happening in an organization. As a result, we store a report id rather than a report name or an account id instead of an account name. This obfuscation of the data enables customer's to normalize ids into names for records.

Every night, we ship these logs to a Hadoop server where we map reduce over the log data to create Event Log Files for organizations enabled with the feature.

As a result, every morning, a customer can download the previous day's log events in the form of CSV (comma separated values) files using the API. We chose CSV as a file format because it's easy to use when migrating data between systems.

Once you have this file, you can easily integrate it with a data warehouse analytics tool, build an app on top of a platform like force.com, or buy an ISV (Independent Software Vendor) built app to analyze and work with the data.

To make it easy to try this feature out and build new kinds of apps, we are including one day of data retention for all Developer Edition organizations. That means if you have a Developer Edition organization already, just log into it using the API and you'll have access to the previous day's worth of log data. If you don't already have one, just go to http://developerforce.com/signup to get your free Developer Edition org.

Application monitoring at Salesforce with Event Log Files has just made auditing and tracking user adoption easier than ever before.



Icons by DryIcons

06 October 2014

#Where is the Salesforce Hacker at Dreamforce 2014



This will be my tenth year presenting at the conference. And every year, I look forward to this event!

When I joined in the Summer of 2005, the big news of the conference was:
  • Customizable Forecasting
  • AppExchange
  • Field History Tracking on Cases, Solutions, Contracts, and Assets
Customizable Forecasting is now in it's third iteration and looks better than ever. 

AppExchange has over twenty-five hundred apps that have been installed over two and one half million times times.

And Field History has grown to almost all objects and over one hundred billion rows of audit data.

But what makes Dreamforce truly remarkable is definitely not the features that we highlight, the band that headlines the conference, or the orders of magnitude growth - it's the people that come to the conference. Every year, I talk with as many customers, partners, and vendors as I can. I love Dreamforce for their stories, for their use cases, for their challenges that they bring to the conference in hopes of replacing those challenges with solutions.

In the words of a colleague of mine, this conference is magical.

If you get a chance, stop by some of my sessions listed below and feel free to introduce yourself. I would love to meet you!


Session
Location
Time
Registration Link
New Event Monitoring: Understand Your Salesforce Org Activity Like Never Before
InterContinental San Francisco Grand Ballroom AB
Monday, October 13th 

12:00 PM - 12:40 PM
Learn the Four A's to Admin Success
San Francisco Marriott Marquis, Yerba Buena - Salon 7
Monday, October 13th

3:30 PM - 
4:10 PM
Event Monitoring for Admins
Moscone Center West Admin Theater Zone
Tuesday, October 14th

11:00 AM - 11:20 AM
Project Wave Use Case: Audit Analytics
Moscone Center West 2007
Tuesday, October 14th

4:00 PM - 
4:40 PM
Do-It-Yourself Access Checks with Custom Permissions
Moscone Center West 2009
Tuesday, October 14th 

5:00 PM - 
5:40 PM
Creating Dynamic Visualizations with Event Log Files
Moscone Center West 2006
Wednesday, October 15th 

3:15 PM - 
3:55 PM
Parker Harris's True to the Core: What’s Next for Our Core Products
YBCA - Lam Research Theater
Wednesday, October 15th 

5:00 PM - 
5:40 PM