How to pass a keyword from URL but keep it hidden? (Adwords)

走远了吗. 提交于 2019-12-11 04:47:35

问题


I'd essentially like to know the keyword that takes a user to my site, but then hide it from the user. So...in my ads I could set up the URL as domain.com?keyword=KW, and then store the keyword in a PHP variable so that I can use it in emails/SMS messages to myself. I don't really want it shown in the URL though as it looks kind of messy.

Is there any way to actually achieve this?

Thanks!


回答1:


Just do a redirect after the user gets to your site:

if(isset($_GET['keyword'])){
   //do whatever function you need to do with the keyword data
   $keyword = $_GET['keyword'];
   //redirect
   header("Location: /");
}

Obviously the location should be where you want to send the user. The "/" will put him at the page/root of where he was.



来源:https://stackoverflow.com/questions/8022603/how-to-pass-a-keyword-from-url-but-keep-it-hidden-adwords

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!