2009
Avoid Data Dispersion with Salesforce and Google Adwords Integration
Integrating lead information from one system such as Google Adwords into a CRM like Salesforce is definitely not a new topic, especially since the Salesforce-Google Adwords integration has been announced for a while now.
I want to highlight the steps required for a seamless integration, as well as a few additional pro-active steps you want to take to keep your Google Analytics data clean. The same concept would apply to other analytics tools you might be running. As Avinash always reminds us, data accuracy is always one of the biggest challenges in web analytics.
Here are my steps:
- Create Adwords and Salesforce accounts.
- Link Google AdWords with Salesforce.
- Exclude SalesForce parameters from Google Analytics.
- Set up AdWords lead tracking.
- View report.
1) Create Adwords and Salesforce accounts
You need to have a Google AdWords account and a Salesforce account before you can integrate them.
2) Link Google AdWords with Salesforce
- In Salesforce, click the Google AdWords Setup tab.

- Enter your AdWords customer ID and login e-mail.

3) Exclude SalesForce Parameters from Google Analytics
When Salesforce performs its integration with AdWords, it appends parameters (_kk and _kt) to all destination URLs in your AdWords account. We suggest that you strip these query parameters out of URL to insure no duplicate entries in your Top Content report.
To strip the query parameters, please follow these steps:
- Login to your Google Analytics account
- Go to “Profile Settings” and then click “Edit”
- Exclude the following query parameters: _kk and _kt

*A note for AdWords managers. Keep in mind that when Salesforce appends the destination URLs with its _kk parameters, this is actually “editing” your AdWords ads and the stats associated with these ads will now reset, according to how Google AdWords works.
4) Set up AdWords Lead Tracking
- Back in SalesForce, click on the Google AdWords Setup tab.
- Click on the “Set up Lead Tracking” button.
![]()
i – Create a Web-to-Lead Form
- Click on the “Create Web-to-Lead Form” button

- Add the form to your page
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> . . . <form action="https://www.salesforce.com/servlet/servlet.WebToLead? encoding=UTF-8" method="POST"> <input type=hidden name="oid" value="xxxxxxxxxxxxxxx"> <input type=hidden name="retURL" value="http://www.mysite.com/thankyou.html"> <label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br> <label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br> <label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br> <input type="submit" name="submit"> </form>
ii – Add the Salesforce Tracking Code to the Website
![]()
Add the following tracking code to every page of your site right before the </BODY> tag
<!-- Begin Salesforce Tracking Code --> <SCRIPT type="text/javascript" src="https://lct.salesforce.com/sfga.js"> </SCRIPT> <SCRIPT type="text/javascript">__sfga();</SCRIPT> <!-- End Salesforce Tracking Code -->
iii – Test Your SalesForce installation
By clicking the “Test your Setup” you will be able to test the installation of the codes in step i and ii

5) View report
This report gives an overview of the leads submitted to SalesForce from your website

For more detailed information, click on each lead and learn more about the lead source

Tags: google adwords, google analytics, pay per click, qualitative analysis, salesforce, search engine marketing, web analytics






Thanks for the tip on removing the URL params.
I’ve just recently integrated google AdWords to salesforce.com and I’m experiencing some issues with regard to lead sources. We have workflows set up in SFDC based upon lead source. We have a Web RFQ lead source when someone requests a quote from our website. It seems as though when someone arrives from google the lead source is being created as Web Direct, for example. If they subsequently submit the Web RFQ form, the lead source seems to remain Web Direct and the workflow never gets triggered… that’s my guess, although I have not confirmed. Anyone else having the same issue?
Hi John,
Let me ask someone who deals with the Salesforce leads to see if they get this problem.
Hi John,
We have noticed that it takes few minutes and some times longer to get the lead source field updated in SF. But if everything is set up properly, the lead source field should be updated with and attribute the lead to its source.
What you also might be experiencing is to do with the attribution model. Say I come to the site today after a click on the site from an organic listing, then the lead source will be google/organic. If tomorrow I come to the site again, by clicking on a Google Ad, the first visit attribution will persist, i.e. the lead will still show as google/organic (not google/adwords).
If you are testing from the same computers/browser, you’ll definitely run into this issue and you might end up pulling your hair that I did. You can clear your cache every time you are re-testing, or test from different computers/browsers.
Thanks,
Feras
“Upon linking your account, Salesforce will update your existing advertisements with special tracking codes. Updating your ads will eliminate all statistics that these ads have accrued. This will not impact any statistics for Keywords, Ad Groups, or Campaigns.”.
So what exactly will be lost?
Salesforce’s email specifically states our ads will be updated so all of our statistics will be eliminated.
We cannot lose any data on our Google Adwords campaigns during this transition.
I am looking for detailed information about what will change on our ads so that we can assure our tracking metrics account for the change during the rollout.
For example, if the tracking URLs are changed, we need to know the updated information so that our conversion tracking and ROI analytics reflect the correct information.
What statistics does Adwords provide in their Dashboard that will be reset by the updates so we know how to account/plan for those changes in our metrics as well.
Please provide as much detail as possible about how salesforce’s side of the integration and how it effects Adwords.
Within Adwords when you make any update to your ad (ad text, display url, destination url), the statistics for these (within Adwords) will be reset, which is the correct behavior since you now have a new ad (you made a change) and the stats that belonged the previous ad should not and do not apply to the new ad.
So here is an example:
I went in there and updated the ad. I just changed the display URL to http://www.e-nor.com and then the statistics were all reset.
So the same thing happens when you create an ad in an account that is integrated with SalesForce. SalesForce makes updates to the destination url by adding the some parameters. The ad is effectively changed and the statistics are reset.
This shouldn’t impact any ROI/conversion tracking.
Hope this helps.
Does SF reset the statistics only once (upon setup), or are the statistics reset regularly?
Hi Julie,
I’ll double check and let you know if I’m wrong, but I am very sure that SalesForce integration will only reset the statistics once.
I am finding that salesforce will regularly delete existing ads, refomat the dest url, creating new ads, losing history.
This is driving me nuts.
How are we supposed to optimize ads, based on history, if it is always stripped away?!
I don’t think that Salesforce would delete ads randomly or on its own. I suggest you check your configuration and see if account updates you are doing might be causing the ad updates.
There is also a link for more details on the subject:
http://blogs.salesforce.com/adwords/conversion_tracking/
You might want to contact SF tech support as well and let us know if you find anything interesting.
Hi,
Very glad to have found this post! I see your using DNN and Salesforce + Adwords, i’m really having issues integrating the three – the web2lead took a while to fix, but now i cant get the adwords tracking working – do you have any tips?
Did you use any custom/generic modules to do the form/script placement?
email me or write back here please!
Regards
Rob
Hi Rob,
We don’t use any special modules to place the Adwords conversion script.
Usually it is as simple as placing the conversion script on the conversion page.
I would start by bugging both Adwords and Salesforce support groups.
Also, was Adwords conversion tracking working before Salesforce integration?
Does adwords conversion tracking need to be turned on?
I wasnt aware of that – thought all you needed was a web2lead form + the salesforce javascript element on every page + the url string added to your adwords add by salesforce…
am i correct?
Ahh… do you use this?
http://www.dnncreative.com/Tutorials/DNNTutorialsforThirdPartyModules/DataSpringsDynamicFormsQuickStartGuide/tabid/467/Default.aspx
The dynamic forms module to post the forms to salesforce?
Not the web2lead generator within salesforce?
I don’t think that the Salesforce integration with Adwords needs the Adwords conversion tracking turned on to register leads on the Salesforce side.
As far as the DNN forms and web2lead form question, we would need to examine how these forms are being used.
Give us a call when you have time; we’d be glad to discuss how we can help you test out the web2lead form and resolve your salesforce tracking issues.
We’ll its all working now – 2 lessons learnt – Salesforce + DNN arent compatible when using , you have to use java script to post the form. Also and more importantly – you cant test the adwords plugin whilst in Salesforce sandbox! It HAS to be done on your live production environment! Which they dont mention in many places…
Thanks for the detailed comments, Rob.
Compatibility and testing issues are something we run into all the time and your experiences will help us and others do it right the first time.
Read your article with interest, particularly point 3 “Exclude SalesForce Parameters from Google Analytics”. I am having huge problems with my Adwords campaigns continually having their destination URL’s changed by exactly the type of appended text string you mention here. Sometimes this happens within hours of me resetting the URL’s back to the correct landing pages. All occurances of our Adwords destibation URLs are associated with the email address ‘adwords.mcc@kieden.com’; Kieden is the company that Google acquired for the technology for SF/Adwords integration. have raised this with Google Adwords tech support (“nothing wrong our end”) and SalesForce Tech support (they think our Adwords account has been hacked). Has anyone else seen this issue? Any remedies? I will have to terminat our Adwords campaigns soon if I can’t stop the destination URL’s being changed.
When AdWords and SalesForce accounts are integrated, the Adwords destination URLs will have “_kk” parameters automatically appended. But these _kk parameters should not affect the destination URL; you are still sending people to the same landing page and the only change is a parameter is added to the URL.
We have seen incidents where sites don’t recognized the ?_kk as a parameter, and you might then need to tweak the destination URL. You can use our Contact form to send us a sample destination URL and will be happy to take a quick look.
If I want make a call to https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8&00N00000005gCis=&_kk={some value}&sfga=00D00000000hdGK&oid=00D00000000hdGK&_kt={some value}
What I mean is can I make a call to the url and pass the parameters through a code.
Hello Abhishek,
That is a good idea.
Google Adwords has a similar way of making a conversion call to a tracking gif with all the parameters in the URL instead of running javascript.
I don’t know if Salesforce has similar functionality.
A quick search didn’t reveal anything useful so your best bet would be to contact Salesforce support or use their forums to see if this can be done.
Having an issue where we are only seeing one of our campaigns being brought into salesforce GA. We’ve had this running for about a year and only one of our campaigns registers in GA’s states within salesforce. I tested last week:
1.) Clicked on one of our Ads for a specific campaign
2.) Landed on our site > browsed to our lead form and submitted.
3.) Lead came in as “Quote Request” – a few minutes later GA changed the lead source to “Web Referral”.
Why doesn’t the campaign register?
Hi John,
Since the “lead source” field is changing from “Quote Request” to “Web Referral”, it’s an indicator that the analytics code is actually working, but the issue appears to be in attributing the correct source i.e. in the test you ran, the lead source should have changed to “Google AdWords” (not “Web Referral”. We have seen cases where the site has page redirects or issues with the URL parameters, so AdWords visits appear as direct or referral. Please take a look and let us know what you find and if you have any other questions or comments.
Thanks,
Feras