In this CRM How-To, we will outline how to tie revenue associated with offline sales to an individual keyword used in a paid search marketing campaign using Microsoft adCenter, Microsoft Dynamics CRM 2011, Asp.net and PowerObject’s PowerWebForm.
Introduction
The Holy Grail of marketing is the ability to track revenue generated from a campaign as well as the associated costs to determine a true return on investment (ROI). Measuring ROI is critical for marketing departments with limited resources as it allows them to spend money where it will have the biggest impact.
Determining what marketing campaign was responsible for the revenue can be a daunting process regardless of how and where you sell products. Most companies use multiple channels and multiple messages to promote their products. In many cases, a customer may hear several promotional messages over time before deciding to purchase.
With the advent of search engine marketing in the late 90’s, tracking revenue became much easier as for all web-based transactions. Unfortunately for products or services with longer sales cycles that are typically tracked via customer relationship management systems, we need to use a different approach to track revenue by keywords.
Summary of Actions
For experienced developers, the following is a quick list of the steps required to track opportunity revenue by keyword. More detailed step-by-step instructions follow below.
- Add query string to ad in AdCenter
- Customize the lead and opportunity entities in Dynamics CRM 2011 to add a field for ad id and keyword id
- Create a new PowerWebForm and create two hidden fields for ad id and keyword ID
- Retrieve the PowerWebForm html source code
- Convert the html code to an asp.net page and modify the code to grab the query string and insert it into the value field of the hidden fields.
- Deploy the lead page to your website
- Update the Lead to Opportunity mapping to make sure the fields are moved to opportunities when qualified.
- Verify the ad id and keyword id are visible in the opportunity.
Add Query String Parameters
To identify the ad and keyword associated with a click, we need to use query string parameters in Microsoft adCenter. Query strings are appended to the Destination URL automatically by adCenter when a user clicks on the link. Add the query string as follows:
- Locate the ad you wish to track and click the ad title to edit the ad
- In the Destination URL field, add “?Adid={AdID}&keywordid={OrderItemID}” to the end of the URL.
- Save the ad
Customize Lead and Opportunity Entities
We need a placeholder in the lead and opportunity entities to store the ad id and keyword id.
- Create new fields in the lead and opportunity entities for ad ID and Keyword ID.
- Add these fields to the lead and opportunity forms so you can ensure that the id’s are moving across correctly
Associating Leads with the Keyword
When the potential customer clicks on your ad, they are directed to a landing page on your site and the query string contains the values for ad id and keyword id. In order to make the connection to your CRM lead record, you will need to pass these values back to CRM whenever you capture information about your potential customer. There are several different techniques you can use:
Option #1 – PowerWebForm as your landing page
Some companies prefer to use a lead capture form as their landing page. This technique works well when the ad text has a specific offer that is actionable by the customer. For example, “Register for our weekly newsletter”. In this example, the user has the expectation that they are registering for a newsletter so asking for personal information is expected. Create the PowerWebForm as follows:
- From Web Forms view, click New and add a new Web form.
- Make sure to enter Lead in the Related Entity field
- Click Save & Close
- After saving the new form, click inside the “Form Fields” sub grid and click Add New Form Field in the ribbon bar.
- Enter “0” in the Display Order field to indicate that First Name is the first field you want displayed
- Enter “First Name” for the field label
- Choose “Text” as the Field Type and enter “100” in the field length value
- Change the “Field Required” box to match the requirements of your entity in CRM.
- Click Lookup Field” and choose the CRM entity field that matches your field. For example, “firstname”
- Click Save & New
- Repeat this process for each field you want in your lead capture form.
- After you have finished creating your standard fields, add two hidden fields for ad ID and keyword ID.
- Enter a number in the in the Display Order field that is one greater than the last field you added
- Enter “Ad ID” for the field label
- Choose “Hidden” as the Field Type
- Make sure the “Field Required” box to is set to no
- Click Lookup Field” and choose your Ad ID field
- Click Save & New
- Repeat the process for keyword ID
- After you have finished creating the hidden fields, click Save & Close
Option #2 – Store query string values in a cookie for later use
For companies that want to use a more traditional landing page, we need to create a cookie to store the query string. Using a cookie allows us to grab the query string if the user comes back to our site at a future date and completes the lead capture form. In addition, if the user clicks on a second ad with a different query string parameter, you will want to overwrite the current cookie to reflect the latest ad they clicked. You can find more information on ASP.Net cookies here (http://msdn.microsoft.com/en-us/library/ms178194.aspx
Once you have completed the process of creating the cookies, follow the instructions in option #1 to create the lead capture form via the Power Web Form.
Retrieve Web Form Source Code
- After you have saved the last hidden field, click the Preview and Deploy icon in the ribbon bar of the Web Form record.
- In the Preview and Deploy Dialog Window, click Copy URL
- Open Internet Explorer, paste the URL into the address window and press Enter
- Right-click on the page and select View Source
- Select the code and copy the contents to your buffer.
Convert to Asp.net Page and Grab Query String
To fill the hidden fields with the values from our query string we need to alter the page code.
- In Visual Studio, create a new ASP.Net web project called “KeywordToLead”
- Add a new web form to the project named “LeadCapture”
- Replace the HTML code in the newly created web form with the code you copied from the CRM Web Form. Make sure you don’t erase the @ Page declaration in the first line.
- If you are using your lead capture form as your landing page, you can insert code to read the query string and insert into the value field of the hidden form elements
- Find the Ad ID form element
- Inert “<%=request.querystring("adID") %>” between the quotes in the value field for the Ad ID form element.
- Inert “<%=request.querystring("keywordID") %>” between the quotes in the value field for the keyword ID form element
- Save your changes and close
- If you are using cookies or another programming language, you will want to make the proper modifications. The goal here is to set the original query string to the value of the hidden field so it is passes to Dynamics CRM.
Deploy and Test Asp.net Web Page
At this point, you should be able to test the web page in Visual Studio.
- In the start options section of Visual Studio, enter a test query string and click “Specific Page”. Press F5 or Run to start testing
- Make sure the query string is appended to the url
- Enter “Joe” for the first name and “CRM” for the last name and click Submit
- After the submission is successful, you may close the window.
Passing ID’s from Lead to Opportunity
Now that our ad ID and keyword id’s are stored in the lead entity, we need to make sure these entities are passed to opportunities whenever a lead is converted. To accomplish this, we need to edit the relationship between leads and opportunities and add mapping elements for our customer id fields.
- In the customization window, click 1:N Relationships under the Lead entity.
- Find the record for related entity = Opportunity and double-click.
- In the Lead to Opportunity window, click Mappings in the navigation menu
- In the Mappings view, click New in the toolbar just above the list of mappings
- In the Create Field Mapping window, find “new_adid” in the source and target lists. Check both and click OK. Repeat for “new_fieldID”
- After adding both mappings, save and close.
Testing
Open Microsoft Dynamics CRM 2011 and proceed to your leads view. You should see a record for Joe CRM
- Double-click on the record and scroll down to where you added the custom ad id and keyword id fields to the lead form. You should see your ad id and keyword id values.
- Click the Qualify button
- Check account and opportunity
- Click OK
- Go to your open opportunities view and find the new opportunity. You should see Joe CRM as the original lead as well as your ad id and keyword id.
Conclusion
So in Part I of Tracking Opportunity Revenue by Keyword, we discovered how we can instruct Microsoft’s adCenter to include ad id’s and keyword id’s into the destination URL for our ad. We also learned how to use PowerObjects' PowerWebForm and ASP.NET to associate these values to leads generated through a lead capture form. And lastly, we learned how to map the id’s from lead to opportunity during the lead qualification process. By doing so, we can begin to build analytics around how much revenue is generated by a click for individual keywords.
In Part II, we will take the next step and dig deeper into how we can evaluate not only the value of a keyword, but the value of ad, campaign or even the differences between revenue generated by search engines.
Happy CRM'ing!