2017-07-24 69 views
0

嗨我想要顯示我的Google Adsense廣告只有當訪問者來自Twitter。目前即時通訊使用的Twitter的代碼,這是工作了Facebook和其他人,但它不工作顯示Google AdSense廣告只有Twitter訪問者

<?php 
      $ref = $_SERVER['HTTP_REFERER']; 
      if (strpos($ref, 'twitter.com') != false) {?> 
<script type="text/javascript"><!-- 
    google_ad_client = "xx-xx-xxxxxxxxxxxxxxxxxx"; 
    /* xxxxxxxx xxxxxx xxx xxx xxx xx xxxxxx */ 
    google_ad_slot = "xxxxxxxxxxxxxx"; 
    google_ad_width = xxx; 
    google_ad_height = xxx; 
    //--> 
    </script> 
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> 
    </script> 
</div> 
</div> 

<?php }else{ 
    echo ""; } 
    ?> 
+0

請不要惡意破壞你的帖子的鏈接。一旦你發佈了一個問題,你已經將內容授權給了Stack Overflow社區(在CC-by-SA許可下)。如果您想取消關聯此帳戶與您的帳戶關聯,請參閱[解除請求的正確途徑是什麼?](http://meta.stackoverflow.com/questions/323395/what-is-the-proper-route-換一個 - 解離 - 請求)。 – Bugs

回答

相關問題