Code to Avoid Social Traffic - But still work with Cached Wordpress Blog

Discussion in 'AdSense' started by Ken_Xu, Mar 28, 2009.

  1. #1
    Hi Guys,

    I found a snippet of javascript code to avoid showing adsense to social traffic. The detail is below, so please give me you opinion about it:

    <script type=”text/javascript”>
    <!––
    var myArray = [];
    myArray[0]= ‘/search?’;
    myArray[1]= ‘.yahoo.’;
    myArray[2]= ’search.’;
    myArray[3]= ‘/search/’;
    myArray[4]= ‘images.google.’;
    for(var i=0;
    i<5;
    i++) {
    if (document.referrer.indexOf(myArray) > -1)
    {
    //––>
    document.write(’<iframe scrolling=”no” style=”width:125px;height:125px;” frameborder=”0″ src=”http://www.whatisyoursite.com/adsense.htm” marginheight=”0″ marginwidth=”0″></iframe>‘);
    }}
    </script>

    You will need to create "adsense.htm" and FTP it to your server. The reason of using Javascript is because it will be executable even you have your blog cached (Wordpress) with cache plugin such as wp-super-cache.

    The only problem is that the code is calling the adsense code using iframe... I don't know if this code will violate Adsense TOS or not....

    But if this code is valid, it will be a great stuff to leverage our overall CTR because most of the Social traffic is "Junk"!
     
    Ken_Xu, Mar 28, 2009 IP
  2. as7apcool

    as7apcool Peon

    Messages:
    168
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    that might get ur account banned mate !
     
    as7apcool, Mar 28, 2009 IP
  3. Tearabite

    Tearabite Prominent Member

    Messages:
    4,628
    Likes Received:
    429
    Best Answers:
    0
    Trophy Points:
    300
    #3
    I think that displaying the Adsense code in an iframe is going to throw-off your targeting..

    i'm not sure why you would go to such lengths to avoid social-traffic anyway; sure the CTR from this type of traffic is low.. but.. so what?
     
    Tearabite, Mar 28, 2009 IP
  4. Ken_Xu

    Ken_Xu Well-Known Member

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    #4
    It simply a little concern about Smart Pricing. I've witnessed my low CTR affected the overall CPC value which results in a lower earning when one of my posts containing Adsense codes got a huge traffic from social media.

    I was using the SSI via PHP code before getting this solution via js. But after applying wp-super-cache with my wordpress blog, the script has become useless it's not a dynamic page now. I found this code at Rhys site via Scratch99.

    If this stuff will throw off my targeting, I guess I have to remove it asap. Thanks for your opinion, greatly appreciate that!
     
    Ken_Xu, Mar 28, 2009 IP