简体   繁体   中英

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

We are running site over PHP WordPress. We also have website ads in 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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