-
AuthorPosts
-
June 12, 2015 at 9:34 am #300049
Hi,
Has anyone set up a way to capture the Google Click ID from visitors who have come from AdWords? I want to save it in a cookie and then send it to Salesforce as a hidden field when the user submits a form.
I can’t find anything related to GCLID in the X forum. I have tried adding Google’s suggested script to the functions.php file of my child theme, but received an error. Here’s the script, from https://support.google.com/adwords/answer/2998031:
<script type="text/javascript"> function setCookie(name, value, days){ var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); var expires = "; expires=" + date.toGMTString(); document.cookie = name + "=" + value + expires + ";path=/"; } function getParam(p){ var match = RegExp('[?&]' + p + '=([^&]*)').exec(window.location.search); return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); } var gclid = getParam('gclid'); if(gclid){ var gclsrc = getParam('gclsrc'); if(!gclsrc || gclsrc.indexOf('aw') !== -1){ setCookie('gclid', gclid, 90); } } </script>
Here’s the error:
unused
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@———– and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Thanks in advance for any tips about the code above OR suggestions as to another approach (using a plugin, etc.)!
June 12, 2015 at 9:55 pm #300486Hi There,
Thanks for writing in! It sounds like you might be having an issue with a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.
Thank you for your understanding.
-
AuthorPosts