谷歌分析显示多长时间?

时间:2013-11-12 14:13:55

标签: google-analytics

GA报告未安装,即使我已经在指定的HEAD位置获得了脚本,如果它立即显示?

我已经完成了如何操作的完整说明,或者我只是需要等待?

代码是

<?php 
    require("config.php"); 
    $submitted_username = ''; 
    if(!empty($_POST)){ 
        $query = " 
            SELECT 
                id, 
                username, 
                password, 
                salt, 
                email 
            FROM users 
            WHERE 
                username = :username 
        "; 
        $query_params = array( 
            ':username' => $_POST['username'] 
        ); 

        try{ 
            $stmt = $db->prepare($query); 
            $result = $stmt->execute($query_params); 
        } 
        catch(PDOException $ex){ die("Failed to run query: " . $ex->getMessage()); } 
        $login_ok = false; 
        $row = $stmt->fetch(); 
        if($row){ 
            $check_password = hash('sha256', $_POST['password'] . $row['salt']); 
            for($round = 0; $round < 65536; $round++){
                $check_password = hash('sha256', $check_password . $row['salt']);
            } 
            if($check_password === $row['password']){
                $login_ok = true;
            } 
        } 

        if($login_ok){ 
            unset($row['salt']); 
            unset($row['password']); 
            $_SESSION['user'] = $row;  
            header("Location: main.php"); 
            die("Redirecting to: main.php"); 
        } 
        else{ 
            print("Login Failed."); 
            $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); 
        } 
    } 
?>  

<!DOCTYPE html>
<html>
    <Head> 
        <title>Fishtrends | Tightlines</title>
        <meta name="viewport" content="width=device-width, intitial-scale=1.0>
        <link href = "css/css/bootstrap.css" rel = "Stylesheet">
        <link href = "css/css/bootstrap.min.css" rel = "stylesheet">
        <link href = "css/css/style.css" rel = "stylesheet">
        <link href = "css/fonts/fonta/css/font-awesome.min.css" rel = "stylesheet">
        <link href='http://fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css'>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-5178940-4', 'fishtrends.com');
  ga('send', 'pageview');

</script>

    </head>
<body>


 <div class = "navbar navbar-main navbar-static-top">
    <div class="container">
        <a href = "#" class = "navbar-brand"><b>Fishtrends</b> - Social Fish trending</a>
        <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div class= "collapse navbar-collapse navHeaderCollapse">
        <ul class = "nav navbar-nav navbar-right">
          <li class = "active"><a href ="/register.php"><i class="glyphicon glyphicon-home"></i> Register</li></a>
          <li class = "dropdown">
            <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown"><i class="glyphicon glyphicon-user"></i> Login<b class="caret"></b></a>
            <ul class = "dropdown-menu" style="padding: 15px; padding-bottom: px;">
                <form action="login.php" method="post"> Username:<br /> 
                    <input type="text" name="username" value="<?php echo $submitted_username; ?>" /> 
                    <br /><br /> Password:<br /> <input type="password" name="password" value="" /> 
                    <br /><br /> 
                    <input type="submit" class="btn btn-info" value="Login" /> 
            </form> 
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>
<div class="indexjumbotron">
  <h1>Be Fish social</h1>
  <p1>Add and see catch details, baits used, weights of fish plus more</p1>
</div>
<div class="container">
                <div class="panel panel-default" style="margin:0 auto;width:500px">
                    <div class="panel-heading">
                        <h1 class="panel-title"><b>Sign up now for Free!</B></h1>
                    </div>
                    <div class="panel-body">
                        <form name="registration" method="post" action="/register.php" class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="username" class="col-xs-2 control-label">Username</label>
                                <div class="col-xs-10">
                                    <input type="text" class="form-control" id="username" name="username" placeholder="Your Userame">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputEmail1" class="col-xs-2 control-label">Email</label>
                                <div class="col-xs-10">
                                    <input type="text" class="form-control" id="email" name="email" placeholder="Your Email">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="inputSubject" class="col-xs-2 control-label">Password</label>
                                <div class="col-xs-10">
                                    <input type="password" class="form-control" id="password" name="password" placeholder="Choose a password">
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-offset-2 col-xs-10">
                                    <button type="submit" class="btn btn-success">
                                        Register
                                    </button>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
<div class = "navbar navbar-inverse navbar-fixed-bottom">

                <div class = "container">
                    <p class = "navbar-text pull-left">Copyright Fishtrends - 2013 <i class="glyphicon glyphicon-copyright-mark"></i></p>
                    <a href = "http://www.twitter.com/fishtrends" class = "navbar-btn btn-primary btn pull-right"><i class="fa fa-twitter fa-1x"></i> Follow Us</a>
                    <p class = "navbar-text pull-right"><a href ="#"><i class="glyphicon glyphicon-question-sign"></i> About Us</a></p>
                </div>

        </div>


            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
            <script src="css/js/bootstrap.js"></script>
</body>
</html>

2 个答案:

答案 0 :(得分:0)

定期报告不会更新几个小时。但是,有一个real-time tab可以立即显示结果。在HTML方面,你有很多缺失/额外/无序标签。我认为这是你在HTML中的目标(我没有包含PHP代码,因为我没有对它进行任何更改):

<!DOCTYPE html>
<html>
<head> 
    <title>Fishtrends | Tightlines</title>
    <meta name="viewport" content="width=device-width, intitial-scale=1.0">
    <link href = "css/css/bootstrap.css" rel = "Stylesheet">
    <link href = "css/css/bootstrap.min.css" rel = "stylesheet">
    <link href = "css/css/style.css" rel = "stylesheet">
    <link href = "css/fonts/fonta/css/font-awesome.min.css" rel = "stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css'>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-5178940-4', 'fishtrends.com');
      ga('send', 'pageview');

    </script>
</head>
<body>

    <div class = "navbar navbar-main navbar-static-top">
        <div class="container">
            <a href = "#" class = "navbar-brand"><b>Fishtrends</b> - Social Fish trending</a>
            <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
        </div>
        <div class= "collapse navbar-collapse navHeaderCollapse">
            <ul class = "nav navbar-nav navbar-right">
                <li class = "active"><a href ="/register.php"><i class="glyphicon glyphicon-home"></i> Register</a></li>
                <li class = "dropdown">
                    <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown">
                        <i class="glyphicon glyphicon-user"></i> Login<b class="caret"></b>
                    </a>
                    <ul class = "dropdown-menu" style="padding: 15px; padding-bottom: px;">
                        <form action="login.php" method="post"> Username:<br /> 
                            <input type="text" name="username" value="<?php echo $submitted_username; ?>" /> 
                            <br /><br /> Password:<br /> <input type="password" name="password" value="" /> 
                            <br /><br /> 
                            <input type="submit" class="btn btn-info" value="Login" /> 
                        </form>
                    </ul>
                </li>
            </ul>
        </div>
    </div>

    <div class="indexjumbotron">
      <h1>Be Fish social</h1>
      <p>Add and see catch details, baits used, weights of fish plus more</p>
    </div>
    <div class="container">
        <div class="panel panel-default" style="margin:0 auto;width:500px">
            <div class="panel-heading">
                <h1 class="panel-title"><b>Sign up now for Free!</b></h1>
            </div>
            <div class="panel-body">
                <form name="registration" method="post" action="/register.php" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="username" class="col-xs-2 control-label">Username</label>
                        <div class="col-xs-10">
                            <input type="text" class="form-control" id="username" name="username" placeholder="Your Userame" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail1" class="col-xs-2 control-label">Email</label>
                        <div class="col-xs-10">
                            <input type="text" class="form-control" id="email" name="email" placeholder="Your Email" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputSubject" class="col-xs-2 control-label">Password</label>
                        <div class="col-xs-10">
                            <input type="password" class="form-control" id="password" name="password" placeholder="Choose a password" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-xs-offset-2 col-xs-10">
                            <button type="submit" class="btn btn-success">
                                Register
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class = "navbar navbar-inverse navbar-fixed-bottom">
        <div class = "container">
            <p class = "navbar-text pull-left">Copyright Fishtrends - 2013 <i class="glyphicon glyphicon-copyright-mark"></i></p>
            <a href = "http://www.twitter.com/fishtrends" class = "navbar-btn btn-primary btn pull-right">
                <i class="fa fa-twitter fa-1x"></i> Follow Us
            </a>
            <p class = "navbar-text pull-right"><a href ="#">
                <i class="glyphicon glyphicon-question-sign"></i> About Us</a>
            </p>
        </div>
    </div>


    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="css/js/bootstrap.js"></script>
</body>
</html>

答案 1 :(得分:0)

我在这段代码中找不到任何错误,你是否尝试过实时报告来澄清。如果安装了代码,那么您可以看到一些实时流量报告,包括推介和其他相关信息。你试过吗?