donglu8344812 2012-01-21 14:48
浏览 56
已采纳

Wordpress广告:每个页面刷新计为多个插件上的3次广告展示(更新:随机#取决于谁查看和浏览器))

I have tried multiple plug-ins for ads and for each page refresh they all count it as 3 impressions.

Any idea why this is happening or how to fix it?

Currently using the Ad Engine plugin, and already tried Simple Ads Manager. Using an Image.

Example Code:

                    <!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
  <meta charset="utf-8">

  <!-- Use the .htaccess and remove these lines to avoid edge case issues.
       More info: h5bp.com/b/378 -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <!--Wordpress Template-->
  <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>  
  <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />  

  <?php wp_head(); ?>

  <meta name="description" content="Saint Petersburg SociaBulls">
  <meta name="author" content="Austin Piazza">

  <!-- Mobile viewport optimized: j.mp/bplateviewport -->
  <meta name="viewport" content="width=device-width,initial-scale=1">

  <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->

  <link rel="stylesheet" type="text/css" href="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/skins/tango/skin.css" />

  <!-- CSS: implied media=all -->
  <!-- CSS concatenated and minified via ant build script-->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" />  
  <!-- end CSS-->

  <!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->

  <!-- All JavaScript at the bottom, except for Modernizr / Respond.
       Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
       For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ -->
  <script src="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/libs/modernizr-2.0.6.min.js"></script>


  <!-- end scripts-->

  <script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        // Configuration goes here
    });
});
</script>

  <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
</head>

<body <?php body_class($class); ?>>

  <div class="wide" id="container">
    <header id="sticky" class="wide">
        <div class="center">
        <a href="#"><h1 id="logo" class="notext">St. Pete Sociabulls</h1></a>
        <ul id="nav">
            <?php wp_list_pages('title_li='); ?>
        </ul>
        </div>
    </header>

<div id="page">
<div id="top"><div id="city"></div></div>
<div id="main" role="main" class="wide">
    <div id="full">
        <div class="center">
            <div id="moveup">

                <div id="main-event">
                     <h2><?php the_title('');?></h2>
                     <?php if (have_posts()) : while (have_posts()) : the_post();?>
                     <div class="whole-post">

                         <div class="post-date">
                            <?php the_date( 'M d' ); ?>
                         </div>
                         <div class="entry">
                             <div class="entrytext">
                                  <?php the_content(); ?>
                             </div>
                         </div>
                     </div>
                   <?php endwhile; endif; ?>
                </div>

                <aside>

                    <?php if ( !function_exists('dynamic_sidebar')  
        || !dynamic_sidebar( 'rightsidebar' ) ) : ?> 
<?php endif; ?> 

<div id="ad-box">
                    <?php if ( !function_exists('dynamic_sidebar')  
        || !dynamic_sidebar( 'Ads' ) ) : ?> 
<?php endif; ?> 
</div>

                </aside>

             </div>
            </div>
        </div>
    </div>
  </div> 


<footer class="wide">
         <div id="seawall">
            <div class="center">
                <div id="sponsors">
                    <?php if ( !function_exists('dynamic_sidebar')  
        || !dynamic_sidebar( 'extra' ) ) : ?>
 <p>This is the deafult sidebar, add some widgets to change it.</p>  
<?php endif; ?> 

                </div>
                <div id="social-page">
                    <div class="fb-like-box" data-href="http://www.facebook.com/swingstampabay" data-width="350" data-height="170" data-show-faces="true" data-stream="false" data-header="false"></div>
                </div>
            </div>
         </div>
    </footer>
  </div> <!--! end of #container -->


  <!-- JavaScript at the bottom for fast page loading -->

  <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  <script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"><\/script>')</script>
  <script type="text/javascript" src="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/lib/jquery.jcarousel.js"></script>

  <!-- scripts concatenated and minified via ant build script-->
  <script defer src="js/plugins.js"></script>
  <script defer src="js/script.js"></script>

  <div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=270668269621466";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=265187160174054";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


  <!-- Change UA-XXXXX-X to be your site's ID -->
  <script>
    window._gaq = [['_setAccount','UAXXXXXXXX1'],['_trackPageview'],['_trackPageLoadTime']];
    Modernizr.load({
      load: ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js'
    });
  </script>


  <!-- Prompt IE 6 users to install Chrome Frame. Remove this if you want to support IE 6.
       chromium.org/developers/how-tos/chrome-frame-getting-started -->
  <!--[if lt IE 7 ]>
    <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
    <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
  <![endif]-->

  <?php wp_footer(); ?>  

</body>
</html>

Plugin Code: https://gist.github.com/1654868

Update: Added all my code together

Thanks!!

  • 写回答

2条回答 默认 最新

  • douxuanjie2692 2012-01-22 04:28
    关注

    NEVER NAME THINGS ANYTHING CLOSE TO NORMAL!!!!

    I can't believe this entire problem was from naming my widget area 'ads'...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮