广告:每一次页面刷新都相当于3次广告印象

时间:2012-01-21 作者:Reuben

我尝试了多个广告插件,对于每个页面刷新,他们都将其计算为3次印象。

知道为什么会发生这种情况,或者如何解决它吗?

目前正在使用广告引擎插件,并且已经尝试了简单的广告管理器。使用图像。

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>

Update: Added all my code together

谢谢

1 个回复
最合适的回答,由SO网友:Reuben 整理而成

永远不要说出任何接近正常的东西!!!!

我不敢相信整个问题都是因为我把我的小部件区域命名为“广告”。。。

结束

相关推荐

如何重写URL以通过AJAX将请求传递给定制方法?(我不能使用admin-ajax.php)

我必须构建一个WordPress插件,为AJAX调用提供HTML。但是,由于服务器环境的原因,我不能使用传统的admin-ajax.php.有人告诉我,我可以使用url重写构建自定义页面,例如:/my-ajax-calls/因此,当我向该页面发送请求时,它将是:jQuery.get(\"/my-ajax-calls/param1/param2/\",...); 那我可以用param1 &;param2 并给出相应的HTML。我知道如何构建插件,如何重写URL以将其与生成HTML的方法连接起