简体   繁体   English

检查用户是否通过点击 Google Adwords 访问网站

[英]To check if the user came to website by clicking Google adwords

We are running site over PHP WordPress.我们正在通过 PHP WordPress 运行网站。 We also have website ads in Google adwords.我们在 Google Adwords 中也有网站广告。 When some user clicks on the ad, it lands on one of the page on website.当一些用户点击广告时,它会登陆网站上的其中一个页面。 On that page, I would like to know if the user came to page by clicking Google adwords or by some other way.在该页面上,我想知道用户是通过点击 Google Adwords 还是通过其他方式进入页面。

Is there any way I could do this?有什么办法可以做到这一点吗? What should I check when user lands on the webpage?当用户登陆网页时我应该检查什么? (Referrer etc.) (推荐人等)

When you create your Google AdWords campaign, use a special click url, containing a query string that you can verify.创建 Google AdWords 广告系列时,请使用特殊的点击网址,其中包含您可以验证的查询字符串。 Like this:像这样:

https://your.domain/page.php?from=adwords

Then, checking it can be done on the server-side by inspecting the query string parameters, like this:然后,可以通过检查查询字符串参数在服务器端进行检查,如下所示:

<?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: /');
    }
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM