Passing AdWords GCLID to Saleforce
-
I’m trying to pass a GCLID parameter from Google AdWords to Salesforce through my form. I’ve set everything up in Salesforce as outlined here. I’m not quite sure what to do on step 3 where it talks about adjusting the web-to-lead form since I’m using your plugin rather than generating a standard web-to-lead form.
I believe the script below has to run to populate the GCLID field. Where would I insert this code? Thanks
Once you have created this new hidden input field, add it to your HTML form in between the <form> tags. On the same HTML lead submission page, add the following code between the head tags:
<script>
window.onload = function getGclid() {
document.getElementById(“xxxx”).value = (name = new
RegExp(‘(?:^|;\\s*)gclid=([^;]*)’).exec(document.cookie)) ?
name.split(“,”)[1] : “”; }
// window.onload() may not be supported by all browsers.
// If you experience problems submitting the GCLID as a
// hidden field, consider using an alternate method to
// call this function on page load.
</script>https://www.ads-software.com/plugins/salesforce-wordpress-to-lead/
- The topic ‘Passing AdWords GCLID to Saleforce’ is closed to new replies.