Exemplo n.º 1
0
<?php 
$options = get_ana_options();
if (!is_user_logged_in()) {
    //  preg_match( '/https?:\/\/(.+?)\//i', get_bloginfo('url'), $results ); //URLからドメインの取得
    //  $domain = $results[1];
    ?>
 <?php 
    if ($options["tracking_id"]) {
        ?>
<!-- Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("<?php 
        echo esc_html($options["tracking_id"]);
        ?>
");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- /Google Analytics -->
<?php 
    }
    ?>
  
<?php 
    //以下その他の解析コードなど
    ?>
Exemplo n.º 2
0
function get_webmaster_tool_id()
{
    $o = get_ana_options();
    return trim($o['webmaster_tool_id']);
}