Google Analytics Campaign Tracker for Salesforce by CloudAmp

Overview | Setup | Reports & Dashboards | Google Adwords Configuration | Visitor Sessions

| UTM Parameters & Fields

Campaign Tracker Setup is Easy

  1. Install the App into your Salesforce org.

  2. Add the javascript tracking code below on all pages of your web site, in the footer or just before the </body> tag.

  3. If your web site forms are not Salesforce-provided web-to-lead forms, please add a hidden field named cloudamp__data__c to your forms.
    <input type="hidden" name="cloudamp__data__c">
  4. Update your Lead and Contact Page Layouts automatically with the tools on the Campaign Tracker tab in Salesforce.

  5. We recommend tagging your Adwords and other advertising URLs with Google Analytics Campaign Tags.
Javascript Tracking Code:

window._cloudAmp = window._cloudAmp || {};
	_cloudAmp.forms = [];
	(function () {
		var scripts = document.getElementsByTagName('script'),
		    sLen = scripts.length,
		    ca_script = document.createElement('script'),
		    head = document.getElementsByTagName('head'),
		    protocol = document.location.protocol,
		    httpsDomain = '',
		    httpDomain = '',
		    filename = 'ctk.js',
		    srcDomain = protocol === 'http:' ? httpDomain : httpsDomain;

		ca_script.type = 'text/javascript';
		ca_script.async = true;
		ca_script.src = protocol + '//' + srcDomain + '/' + filename;

Please Note: Tracking code should be placed at the very end of your web page before </body>, and be careful not to add any line breaks.

That's it! Once this code is pasted into your web site and published, the next time a visitor submits a form on your web site, their campaign and source information will be tracked.

For additional information on configuring the Campaign Tracker inside Salesforce, such as activating email notifications, see our Complete Documentation


  1. Salesforce Unlimited, Enterprise or Professional Edition
  2. Ability to add javascript tracking code to your web site
  3. Salesforce Web-to-Lead forms (or other lead forms you can add a field to) on your web site

Please Note: Web-to-lead forms that use the HTML generated in Salesforce will work automatically with no changes. For custom signup forms you need to add a hidden field to the forms named cloudamp__data__c, and ensure it gets passed through to Salesforce. For forms that use their own field names such as GravityForms or FormAssembly, please see our Complete Documentation

Please contact us for more information regarding your specific situation.


Overview | Setup | Reports & Dashboards | Google Adwords Configuration | Visitor Sessions

| UTM Parameters & Fields

Get it now on the AppExchange® >

For customizations or questions, please contact us.

Support Resources

Complete Documentation


Javascript Code for your website

Related Articles from our Blog

How to Track Multi-touch Attribution in Salesforce

Camapign Tracker 2.0 Launches

How to Customize Salesforce Dashboards

6 Ways to Build a Lead Machine with Salesforce (guest post on Salesforce blog)

The Opportunity of '(Not Provided)' Google Keywords

Lead Tracking 101: Understanding Advertising ROI in Salesforce

Tracking Google Adwords Results in Salesforce

Replacing Salesforce for Google Adwords

6 Challenges with Tracking Adwords Conversions in Salesforce

How to get a detailed Email about every new lead in Salesforce