Rotate Header Based on Keywords

by merkin
4 replies
Does anyone have a script that will allow me to rotate my landing page's heading based on the specific keywords that came to my site? For example, if someone clicks on one of my Google Ads, I will display the keywords in that respective ad so my landing page header is relevant to my users... Thanks.
#based #header #keywords #rotate
  • Profile picture of the author Brandon Tanner
    This should do it. Just use the following format for your Google ad hyperlink...

    www.YourWebsite.com?k=YourKeywordHere

    Now just paste the following code into the very top of your landing page...

    <?php

    $k = $_GET["k"];


    if ($k == "keyword 1")

    {$header = "Header 1 text goes here";}

    elseif ($k == "keyword 2")

    {$header = "Header 2 text goes here";}

    elseif ($k == "keyword 3")

    {$header = "Header 3 text goes here";}

    else {$header = "Default header text goes here";}


    ?>


    Then paste the following code where your header text should appear...

    <h1><?php echo $header; ?></h1>

    Don't forget to change the parts in red to your desired text, and give your landing page a .php extension (index.php). And if you need to add more keywords just add more 'elseif' statements to the php code.
    Signature

    {{ DiscussionBoard.errors[3528707].message }}
    • Profile picture of the author millions
      I needed this as well! Thank you!

      How would do it from referred keywords? For instance, if I have a PPV source and I wanna use the domain I've bid on to deliver a custom message, how might that work?
      {{ DiscussionBoard.errors[3528748].message }}
      • Profile picture of the author Cliff_OBA
        Check out the first response. In the url, there is a k=xxx line component. In the code sample below, that goes on your site, there is logic to make s decision based on the value passed in along with the url (xxx of the k=xxx). You can apply the same approach anywhere by controlling what to include as the 'xxx' part of the url and adjusting the logic in the PHP snippet as needed.

        If this is too technical, maybe elaborate on what you need and someone can adjust the first response to demonstrate how it can work.

        Cliff
        {{ DiscussionBoard.errors[3528780].message }}
  • Profile picture of the author millions
    Thanks for explaining that a bit more that really helped!
    {{ DiscussionBoard.errors[3553556].message }}

Trending Topics