function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David PiperatoDavid Piperato 

How can I capture the URL of the landing page a chat visitor entered our site through?

I am posting this in Java development because I saw a post (referenced below) on stack exchange that suggested I could achieve the desired results with a bit of Javascript. I apologize if this is not that correct place for this question. 

We have added the Salesforce Embedded Service Chat Deployment to one of our websites. The majority of the traffic to this site is coming from Google Ads paid search. If a user chats with us, I'd like to be able to attach the full URL string to the lead, so if the chat results in a conversion I can pass the GCLID back into Google Ads for smart bidding optimization. Salesforce supported pointed us to this article, but the script didn't work for us (perhaps we implemented it incorrectly?): Capture URL of webpage containing Live Agent chat button Can anybody help? To clarify, the URL with all the necessary parameters that I want to capture would look something like this: https://ourdomain.com/landing-page/?b1&utm_source=gaw&utm_medium=cpc&campid=11538955864&adgid=111969187389&kwd=%2Bkeyword&mt=b&s&dev=m&dm=&nw=g&crid=476869308431&gclid=Cj0KCQiA-aGCBhCwARIsAHDl5x9cVnQmdj3yw7lEqUewRWyXCcjx5Hw1NJEGiRjeeq6FEjZW4JNhxE4aAnOjEALw_wcB
VinayVinay (Salesforce Developers) 
Hi David,

I think this is OOB functionality in salesforce.  Would recommend you to log a case with salesforce to have inputs on this functionality.

Thanks,