Php 通过点击谷歌广告词检查用户是否访问了网站
我们正在通过PHP WordPress运行该网站。我们也有谷歌广告词的网站广告。当一些用户点击广告时,它会落在网站的一个页面上。在那个页面上,我想知道用户是通过点击GoogleAdwords还是通过其他方式进入页面的Php 通过点击谷歌广告词检查用户是否访问了网站,php,wordpress,google-ads-api,referrer,Php,Wordpress,Google Ads Api,Referrer,我们正在通过PHP WordPress运行该网站。我们也有谷歌广告词的网站广告。当一些用户点击广告时,它会落在网站的一个页面上。在那个页面上,我想知道用户是通过点击GoogleAdwords还是通过其他方式进入页面的 我有什么办法可以这样做吗?当用户登陆网页时,我应该检查什么?(推荐人等)创建Google AdWords活动时,请使用一个特殊的单击url,其中包含一个可供验证的查询字符串。像这样: https://your.domain/page.php?from=adwords 然后,可以通
我有什么办法可以这样做吗?当用户登陆网页时,我应该检查什么?(推荐人等)创建Google AdWords活动时,请使用一个特殊的单击url,其中包含一个可供验证的查询字符串。像这样:
https://your.domain/page.php?from=adwords
然后,可以通过检查查询字符串参数在服务器端进行检查,如下所示:
<?php
if ($_GET['from'] == "adwords") {
/* do special stuff, like store things in a database */
/* Finally, maybe redirect them to some other page, if necessary */
header('Location: /');
}
?>
创建Google AdWords活动时,请使用一个特殊的单击url,其中包含一个可以验证的查询字符串。像这样:
https://your.domain/page.php?from=adwords
然后,可以通过检查查询字符串参数在服务器端进行检查,如下所示:
<?php
if ($_GET['from'] == "adwords") {
/* do special stuff, like store things in a database */
/* Finally, maybe redirect them to some other page, if necessary */
header('Location: /');
}
?>
您可以先查看您的推荐人https://stackoverflow.com/questions/1864583/get-original-url-referer-with-php
然后根据您的目的设置if-else条件。如果重新引用adwords做其他事情做其他事情,您可以先查看您的引用https://stackoverflow.com/questions/1864583/get-original-url-referer-with-php
然后根据您的目的设置if-else条件。如果重新引用adwords,请执行其他操作