Omniture – SalesForce Integration: Take 2
In the beginner’s mind there are many possibilities.
The developer side of my brain refuses to believe that there is only one way to do things, so after spending a great deal of time and effort to integrate SalesForce data into Omniture using the standard Genesis integration I felt that there had to be another way. If you have not read the recent posts by Adam Greco on getting CRM data into Omniture, stop reading this post and go read those first. Then come back!
What I needed to do was find a way to get a few data points out of SalesForce and into Omniture SiteCatalyst. The solution also needed to be automated so that it could run every 3-4 hours. After thinking over the topics discussed is Adam's blog post I had a plan.
The Challenge:
State over time. That is what this whole exercise comes down to. How to get Omniture SiteCatalyst to store and measure the state of a data point over a set time. These data points are up to you and your specific business needs. Some examples are revenue, leads, etc..
The granular level of data you can/want to pull over is limited only by your your business objectives. For the purpose of this post, I will only be talking about getting data at a campaign level.
The Setup:
Transaction ID's and a matching key in SalesForce. If you can, I strongly recommend using the SalesForce campaign id's as your web analytics campaign ID's. It give you a great 1:1 data point between the two systems. It also makes it easy to use that campaign ID as your transaction ID.
Incrementor Events. (2 for every data point in SalesForce that you want to integrate) These are needed to accomplish the heavy lifting of the state over time. If you want to track revenue attributed to a specific campaign for example, you create 2 events. One revenue_positive event, and one revenue_negative event. Later you will create a calculated metric to get the delta of these two events to get the actual number.
State Manager. You have to have some mechanism to get the data out of SalesForce and then be able to determine the difference in the value of the data points you want to integrate into Omniture. There are numerous ways that you could accomplish this, but I chose to write a custom ColdFusion / SQL solution.
The flow chart above shows at a high level all of the steps in the process.
1) Pull a list of transaction ids/ campaign ids from Omniture and store that list in a new db table.
2) Loop over that table and query SalesForce to get the data points you want to move, and store that in a second database table.
3) The very first time you run this process you are creating the state. This copies the data into the third state database table. Each time after that, you compare the values in the 3rd table with the data in the 2nd table. This drives the values you pass into the incrementor events. If the first time you pull data from SalesForce to find the revenue for a campaign is $100.00 that gets stored in the third table. You pass 100 to the revenue_positive and 0 to the revenue_negative. The next data pull the revenue is now 110. After the comparison, you pass a 10 to the revenue_positive and 0 to the revenue_negative. Now on a future data pull, you find the revenue is down to 50. You now send a 0 in the revenue_positive and a 60 to the revenue_negative events. When you create the calculated metric you will see the new value of 50 for that calculated metric.
<cfset variables.revenuewon_str="#variables.revenue_pos_event#=0|#variables.revenue_neg_event#=0"> <cfif variables.DIF_revenuewon EQ 0> <cfset variables.revenuewon_str="#variables.revenue_pos_event#=0|#variables.revenue_neg_event#=0"> <cfelseif variables.DIF_revenuewon GT 0> <cfset variables.revenuewon_str="#variables.revenue_pos_event#=#variables.DIF_revenuewon#|#variables.revenue_neg_event#=0"> <cfelse> <cfset variables.revenuewon_str="#variables.revenue_pos_event#=0|#variables.revenue_neg_event#=#ABS(variables.DIF_revenuewon)#"> </cfif>
The code sample above evaluates the difference in the data point between tables 2 and 3 and generates the string required to send the data to Omniture.
4) Push the data to Omniture. After you create the txt file with the transaction id and the values for the events, set up an automatic ftp using the Omniture DataSources.
5) Automate. Since the controlling code to power this process was ColdFusion, all that was required was to set up a scheduled task within the ColdFusion admin and done!
The Result:
Now, right inside of SiteCatalyst, you can see SalesForce data points that matter to you in your reports. Of course, the data will look much cleaner that my mocked up image...hopefully.
Omniture / SalesForce Integration: Part 2 – s_code & more.
If you missed Part 1, read it first.
The past few weeks have brought some significant progress in the Omniture & SalesForce integration efforts. Thanks to the folks at Omniture we were able to figure out what was causing the data between the two systems not to flow.
Within the SalesForce Campaign Module, the following new Omniture data fields must be populated: Allocation & Origin

Once this was set, the data exchange began to work right away. Well..... it began to work the next day, as the data exchange happens once a day.
Now to back up a step. Part of the integration is making some changes to the s_code.js file. Using the setCookieParam function you need to set additional values:
s_code Changes
var external_campaign_param ='campid'; var internal_campaign_param ='iCampid'; var retouch_campaign_param ='rtCampid';
Page Code Changes
s.eVar20 = s.setCookieParam(external_campaign_param,s.getQueryParam(external_campaign_param),1,365); s.eVar22 = s.setCookieParam(internal_campaign_param,s.getQueryParam(internal_campaign_param),1,365); <pre id="line531">s.eVar23 = s.setCookieParam(retouch_campaign_param,s.getQueryParam(retouch_campaign_param),1,365);
Note: The eVar's used above should be the same that you set up in Part 1 as defined in the implementation guide.
These values will give you the ability to pass these values along whenever you submit data to SalesForce using Web2Lead or RingLead or however you submit data into SalesForce.
<cfhttpparam type="Formfield" value="#arguments.omtr_clm__campaign_external__c#" name="omtr_clm__campaign_external__c"> <cfhttpparam type="Formfield" value="#arguments.omtr_clm__campaign_internal__c#" name="omtr_clm__campaign_internal__c"> <cfhttpparam type="Formfield" value="#arguments.omtr_clm__campaign_retouch__c#" name="omtr_clm__campaign_retouch__c">
As of the writing of this, data has been flowing between SalesForce & Omniture for one week. It's too early in the process to get a full understanding of how we will best be able to leverage the data exchange between the systems, but I am looking forward to exploring this further.
Code snippets above are based on a ColdFusion environment and are meant to serve as psuedo code
-Rudi
Omniture/SalesForce Integration Part 1: Configuration
As I set out on my latest adventure with Omniture, I decided to begin this project by actually reading the manual first. So, I downloaded and read the SalesForce: Genesis Integration Guide from Omniture. Ok..fine..maybe I skimmed some pages, but I read most of it. What I took away from it, was I was going to need to really plan this project out.
For starters, I was a bit stunned to discover that the default integration would take 9 eVars and 22 Custom Events, with an additional 33 custom events. (Holy smokes! 50 plus custom events!)
So based on the information from the manual, which is about the only information online I could find about the process, this was my initial task list:
1. Confirm SalesForce requirements with resident SalesForce expert.
2. Determine list of integration Custom Events needed. (which iof the 53)
3. Activate SalesForce Genesis plugin
4. Make changes to primary s_code files
5. Initial testing
6. roll out s_code changes to other report suites.
1 & 2 were easy.
#3. This was a whole other beast. I quickly realized that I needed to have the help of our resident SalesForce Expert to help with the configuration. There is simply too much about SalesForce data fields that I do not know. Not to mention the little bits of information that the Integration Guide leaves out.
Here are the items that were more of a challenge in the process, due to either missing information in the guide or lack of SalesForce knowledge.
eVar Classifications:
- You must set up classifications for each eVar.
- The select box provided to select SalesForce data fields is way way too narrow to be able to read the data field names.
Configure the SalesForce.com Dashboard:
- You must add classifications for all elements on this page.
- The options provided to add classifications on this page are directly pulled from the classifications selected on the eVar Classifications.
- If you have to go back to edit your eVar Classifications any options selected here will not be saved.
Map SiteCatalyst Events
- Even though the Integration Guide says that the Marketing Sourced/Touched: Opportunitiy: New is optional...it's not. I had to add a mapping for this.
#1 thing I learned in the configuration: make darn sure you have a great SalesForce person to assist you with this. I am sure I would never have selected the right objects to classify without their help.
It is also apparent that I need a new task list, one that contains a lot more details and steps than I first planned. I will be working on fleshing this out as I progress through the rest on the integration.
This ends the configuration portion of my adventure, off to make changes to the s_code.
-Rudi




