Change Google Compaign Precedence

Goolge Analytics attributes conversion to the most recent campaign.

To attribute conversions to the first campaign, tag all campaign links with utm_nooverride=1

Google Analytics attributes conversions to the campaign that most recently referred the visitor.
For example, let’s say that someone discovers your site by clicking one of your AdWords ads.
Then, they come back to your site by clicking a banner ad that you’ve tagged with campaign variables. This time, they convert to one of your goals.By default, the banner ad will get the credit for the conversion, not the AdWords ad that originally referred them.To change this behavior, you can tag all of your campaign links with utm_nooverride=1.
If you do this consistently with all of your campaigns, Google Analytics will attribute conversions to the first referring campaign, instead of the most recent one.
Note that the utm_nooverride setting can be used in conjunction with autotagging.

Google Analytics Code track two site

Google Analytics multiple site acculated report

If you want to track all of your sub-domain site for the overall Google Aanlytics report. see below.

Sample: The following example first uses the default tracker, and then creates and uses another tracker (arbitrarily called t2).

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-65432-1']);
_gaq.push(['_trackPageview']);

_gaq.push(['t2._setAccount', 'UA-65432-2']);
_gaq.push(['t2._setDomainName', 'foo.com']);
_gaq.push(['t2._trackPageview']);
Reference from:http://code.google.com/intl/zh-TW/apis/analytics/docs/gaJS/gaJSApi_gaq.html

Google’s Stats About the Web

Google has recently published a report about the Web, which includes a lot of interesting stats. The results were obtained from a sample of 4.2 billion web pages indexed by Google.

“The average web page takes up 320 KB on the wire (Google took into account the embedded resources such as images, scripts and stylesheets). Only two-thirds of the compressible material on a page is actually compressed. In 80% of pages, 10 or more resources are loaded from a single host.”

The average number of images per page is 29.39 and the average size of all the images from a page is 205.99 KB. A web page includes an average of 7.09 external scripts and 3.22 external stylesheets. The average size of the scripts is 57.98 KB and the size of the stylesheets is 18.72 KB. Google also found that only 17 million pages from the sample use SSL (about 0.4%).

Urs Hölzle, Google’s Senior Vice President of Operation, said that the average web page takes 4.9 seconds to load and it makes 44 calls to different resources. “Speed matters. The average web page isn’t just big, it’s complicated. Web pages aren’t just HTML. A web page is a big ensemble of things, some of which must load serially,” said Urs Hölzle.

Google offers a lot of tutorials that help web developers improve the performance of their websites. Google advises to use Gzip compression, use HTTP caching, optimize JavaScript code and properly combine scripts and stylesheets.

from Google Operating System by Alex Chitu

Account Optimization: Google Analytics for Channels

Google Analytics is a great way for our advertising and content partners to track and measure traffic to their YouTube brand channels. A leader in online analytics, Google Analytics provides a comprehensive view of how visitors interact with channels, answering questions such as:

  • How do visitors find my brand channel?
  • How loyal are my viewers: how often do they come back to my channel?
  • How much time do people spend on my channel?
  • Where are my users located and what languages do they speak?

For more details details on how to use Google Analytics, please visit the Google Analytics Getting Started Guide.

At this time, Google Analytics is only available on brand channels. YouTube Insight, our video analytics tool, provides detailed metrics on video views and community engagement for all users.

Setting up Google Analytics on your Brand Channel

  1. Sign up for a Google Analytics account at http://www.google.com/analytics.
  2. If you have an existing Google Analytics login, you may create a new account by selecting “Create New Account” in the drop-down on the top right of the page. While it is possible to create a new profile within an existing account by selecting “Add New Profile”, we recommend creating a new account so that the data from your YouTube channel does not impact the data summaries from your other websites.
  3. Locate your Google Analytics Profile ID, which takes the form of “UA-123123-1”. This can be found while in the Overview of the account, listed with the website profiles.
  4. Log into your YouTube account and navigate to Account > Branding Options > Google Analytics Account ID. Paste your Profile ID into this field and select “Save Branding Options”.
  5. Once you save your changes, you should allow up to 24 hours for data to appear in your account. If you wait 24 hours and still don’t see any data, please read Why isn’t Google Analytics tracking my Website?.
  6. (Optional) So that your YouTube rep may assist you if you have any questions related to your account, we request that you grant access to brandchanneltracking@gmail.com. For instructions on adding users, please refer to the Analytics Help section on user access.

Accessing your Google Analytics Reports

  1. Log in to http://www.google.com/analytics and select the account you created for your YouTube Brand Channel.
  2. If you have multiple profiles in this account, select “View Report” next to the appropriate profile.
  3. From here, you can access all of the data collected on your channel through the navigation on the left and right side.
  4. For more information about the types of reports available in Google Analytics, please refer to the Google Analytics Help Center on reporting basics.

Reference from: http://www.google.com/support/youtube/bin/answer.py?hl=en&answer=147619

Google Ad Planner

Google Ad Planner 是 Google 2008年6月24號發佈的一個免費的媒體計劃工作,它能夠說明廣告主或廣告代理商通過定義廣告目的受眾的人口統計特徵和興趣愛好後,快速找出這些受眾有可能訪問的網站,從而使得他們借助這些訊息能做出更加明智的廣告投放決策。

1、Google Ad Planner 提供的資料資料

  • 通 過 Google Ad Planner,會員幾乎可以查詢到所有網站的諸多敏感資料。大至 Yahoo、百度、新浪、搜狐、QQ、網易等大牌網站,小至一些個人部落格,比如本站。不過 Google 不提供它自身公司旗下網站的資料,比如查詢 Google、Youtube,都是看不到資料的。
  • 可以查詢到的敏感封包括:網站流量(UV、PV、到達率、總訪問量、人均訪問次數、人均停留時間)、訪客特徵(性別、年齡、教育程度、家庭收入)、網站分類、廣告訊息(支援的廣告類型、日平均展現)等,資料來源於40多個國家以30天作為一個統計區間每30天更新一次
  • Google 認為因為這些資料是基於海量的查詢和網站資料而估算出來的,已經精確到了可以直接拿來供廣告決策使用的程度。

2、Google Ad Planner 的資料來源猜測

Google 對 Google Ad Planner 資料來源的官方解釋中內含:

  • 整合過的 Google 搜尋資料
  • Google Analytics 的匿名資料
  • 其他外部的消費者面板資料
  • 第三方市場研究機構的資料
  • Google AdSense 的資料(官方解釋中沒有提及,但是說明中提到);

除了上述來源外,網友猜測的其他來源還有:

  • Google Toolbar 的監控資料(參見:TechCrunchsearch engine land
  • Google 各服務的會員帳號資料(參見:月光部落格

Danny Sullivan 還特地就 Google Ad Planner 是否使用了 Toolbar 的資料向 Google 求證,得到的答覆是無可奉告,因為這是 Google 不能說的密碼(secret sauce),不過 Danny Sullivan 因此更加確信 Google Ad Planner 用了 Toolbar 的資料。

3、對 Google Ad Planner 具體資料的來源分析

下面結合已有資料,我對 Google Ad Planner 的資料來源進行一個比較主觀的分析,看看 Google Ad Planner 提供的具體資料大概是怎麼來的。

網站流量

  • 將網站按照是否使用了 Google Analytics 分為兩類:
    • 使用了 Google Analytics 的網站(GA 網站)
    • 百度、Yahoo 等不會使用 Google Analytics 的網站(NGA 網站)
  • 從 Toolbar 的監控資料中可以得到大部分網站的初步流量(TB 值)
  • 從大量設定了「資料共享」的 Google Analytics 帳戶中可以獲得 GA 網站的 GA 訪問統計資料(GA 值,benchmarking data)。然後與它們的 TB 值進行對比,可以得到真實流量與初步流量兩者大概的比值(GATB 值);
  • 根據 TB 值和 GATB 值,Google 可以估算出 NGA 網站的真實流量。

若果上述假設成立的話,Google Ad Planner 的網站流量資料主要來源於:

  • Google Analytics 的匿名資料
  • Google Toolbar 的監控資料

訪客特徵

Google Ad Planner 說明中說明目前訪客的人口統計資料來源內含:

  • 第三方市場研究機構的資料
  • 其他外部的消費者面板資料

鑒於目前 Google Ad Planner 確實只能提供來自美國的訪客特徵,我覺得上述說法是可信的。月光部落格發現「中 文網站統計中,以海外網站較多,特別是北美的中文網站很多(裡面很多網站從國內無法訪問),而國內的很少」,出現這樣的怪現象就是因為 Google Ad Planner 目前只包括美國的訪客特徵資料的緣故,用美國的訪客特徵資料去篩他們可能訪問的中文網站,出來的自然是北美會員比較喜歡上的而往往已經被 GFW 和諧了的那些網站。

網站分類

Google Ad Planner 說明中說明網站的分類屬性主要是系統自動建立的,修正資料來源於

  • Google Analytics 的匿名資料

這個說法比較可信,不過比較搞笑的是百度被分類為「Government & Regulatory Bodies」。

廣告訊息

關於網站支援的廣告類型,日平均展現等資料,毫無懸念應該來源於:

  • Google AdSense 的資料
  • Reference from: http://por.tw/seo/rewrite.php/read-73.html

    Tracking Zero Result Searches in Google Analytics

    September 8, 2009 by Justin Cutroni

    I <3 Google Analytics Site Search reports. There’s amazingly actionable data in those reports. But they’re missing one vital piece of information: searches that don’t produce any results.

    Why is this important? Don’t you want to know when visitors search and don’t get any results? Zero result searches can help your identify missing content on your site or a problem with your site search engine.

    fenway-scoreboard

    Many search solutions will provide this information for you. For example, I use Search Meter for WordPress and it shows me which search queries generate zero results. But I thought it would be interesting to add this data to Google Analytics. That way all my site search information would be in one place.

    Unfortunately there is no easy way to add this data to GA. You need to do some programming to collect the data. So this post is really meant for those folks with programming resources AND for those developers that maintain GA plugins. Like my buddy Joost, who has a great GA plugin for WordPress.

    If you’re interested in the data and analysis, skip to the bottom of this post.

    Conceptual Overview

    Our goal with this hack is to modify site search data in two ways. First, we’re going to put all search queries with zero results in a category. This will allow us to use the Search Categories report to easily find all the search terms that yielded zero results.

    Second, we’ll modify the actual search terms to indicate that a term yielded zero results. This will make it easy to scan a list of all the search terms and identify which generated no results.

    Before we get into the implementation, a big THANK YOU to Charles Miller, one of the lead consultants here. He wrote the JavaScript below. Thanks Charles.

    Step 1: Identify No Result Search

    The first step is to identify a zero results search page. Most websites have the same search results page regardless of the number of results. You need to identify some something that differentiates a zero results search page from a non-zero results search page.

    This must be done programatically and is the hardest part of the implementation.

    For example, a zero results search page on this blog has the text “No posts found. Try a different search?”

    No Posts Found

    I can create code (or more specifically, Charles can create code) to look for the text “No posts found. Try a different search?” If the code finds this text in the page then I can identify that the visitor’s search yielded zero results and than I can send the data sent to GA. Here’s the code that I’m using on this blog:

    
    var content = document.getElementById('content');
    if (content.innerHTML.search('No posts found.')) {
    

    The code looks for a section of the page called ‘content’ and then searches that section for the phrase ‘No posts found.’. If ‘no posts found.’ is found (oh, the irony!) then we will modify the data sent to GA.

    Important! The way you detect a zero result search page may be different. It’s VERY difficult to create an example that will work for everyone. Take this as a conceptual overview.

    Step 2: Tweak GA Tracking Code

    Once we know what differentiates a zero results search page we can add some code that tweaks the data. Remember, we want to modify the data in two ways: 1. by placing it in a special search category and 2. by modifying the search term to indicate it did not yield any results.

    To create the category all we need to do is add an extra query string parameter to the URL.

    To manipulate the search term we need to split apart the page URL and then put it back together with the phrase no-results.

    Here’s the complete code.

    
    <script type='text/javascript'>
    var pageTracker = _gat._getTracker("UA-XXXXXX-1");
    var content = document.getElementById('content');
    if (content.innerHTML.search('No posts found.')) {
         // These lines get the search data from the URL and
         //  deconstruct the URL into parts
         var sn = "s";
         var sr = new RegExp(sn+"=[^\&]+"),
          p = document.location.pathname,
          s = document.location.search,
          sm = s.match(sr).toString(),
          srs = sm.split("="),
          // The next line is where we add the category and add
          // the phrase no-results to the search term.
          sre = sm.replace(sr,srs[0]+"=no-results:
     "+srs[1]+"&cat=no-results"),
          sf = s.replace(sr,sre);
          // Send the data to Google as a Pageview
          pageTracker._trackPageview(p+sf);
    } else {
          // If this is a regular page on the site, use the standard GA code.
          pageTracker._trackPageview();
    }
    </script>
    

    The code starts with the section that identifies a zero result search page.

    Then we deconstruct the URL to identify the search term. Finally we add the category named ‘no_results’ and the phrase ‘no-results’ to the search term.

    If the code does NOT find the term ‘No posts found.’ then a pageview is created as normal.

    That’s it for the coding part (thank goodness!)

    Step 3: Configure Site Search Settings

    The last step is to add the new category parameter to the Site Search settings so GA can identify the no-results search category. This is easy, it’s in the profile setting section of Google Analytics.

    How to set a search Category parameter in Google Analytics

    I also like to set the ‘Strip Query Parameter’ to YES. This removes the category parameter after site search is done processing and normalizes your pageview data.

    That’s it for the configuration! We’re cleared for insight-hunting!

    Analyzing The Data

    When a visitor performs a search that yields zero results the search term will be placed in a category named ‘no_results’. To find this data navigate to the Content>Site Search>Categories Report:

    site-search-categories-google-analytics-2

    Immediately you’ll be able to see what percentage of your searches yield zero results. Hopefully it’s very low! Want to see if this impacts conversions or revenue? Click the Goals or Ecommerce tab to check the conversion rate:

    Zero Result Searches Impact on Website Outcomes

    This is a bad picture, but you get the point.

    Next you can click on the no-results line in the data and see exactly which search terms yielded zero results.

    Search terms that had no results in Google Analytics

    This is super-actionable data. Now you know where you may be missing content or if your site search engine might be broken. You should be asking yourself, “Why are there no results for these terms? Is there missing content or is there a problem with my site search engine?”

    You’ll also notice that the search terms now have ‘no-results’ in them. This provides a lot of flexibility for view the search data other ways. Example, let’s use the Search Terms report:

    Google Analytics site search queries

    Here we can see the search terms ranked by searches. What percent of your top 10, 20 or 50 are no-result searches? How is that impacting your bottom line?

    This is just the start. You can use other metrics, like %Search Exists to understand if visitors who receive zero results refine their search or exit.

    While this is not the easiest thing to configure, I hope you see the value of the data. More so, I hope that all those folks that maintain plugins add this type of feature to their GA plugins. Joost, you listening!?

    Resource from: http://www.epikone.com/blog/2009/09/08/tracking-ero-result-searches-in-google-analytics/

    Permanent Redirect with HTTP 301

    redirect

    HTTP 301 Redirect in ASP.NET

    <script runat=”server”>

    private void Page_Load(object sender, System.EventArgs e)

    {

    Response.Status = “301 Moved Permanently”;

    Response.AddHeader(“Location”,”http://www.new-url.com/”);

    }</script>

    HTTP 301 Redirect in ASP-VBScript
    <%@ Language=VBScript %>
    <% Response.Status = “301 Moved Permanently”
    Response.AddHeader “Location”, “http://www.somacon.com/”
    Response.End
    %>

    HTTP 301 Redirect in PHP
    <?php header(“HTTP/1.1 301 Moved Permanently”);
    header(“Location: http://www.somacon.com/”); exit(); ?>

    HTTP 301 Redirect in ColdFusion
    <CFHEADER statuscode=”301″ statustext=”Moved Permanently”>
    <CFHEADER name=”Location” value=”http://www.somacon.com/”>

    HTTP 301 Redirect in Perl
    #!/usr/bin/perl      -w
    use strict;
    print “Status: 301 Moved Permanently\n”;
    print “Location: http://somewhere/page.htm\n\n”;
    exit;

    Redirection with Javascript
    <html>
    <head>
    <script type=”text/javascript”>
    window.location.href=’http://www.somacon.com/’;
    </script>
    </head>
    <body>This page has moved to <a href=”http://somacon.com/”>http://somacon.com/</a>
    </body>
    </html>

    Note that they syntax document.location=”; has been deprecated. Use the above code, or alternately, document.URL=”;.

    Redirection with META Refresh
    <html>
    <head>
    <meta http-equiv=”refresh” content=”0;url=http://www.somacon.com/”>
    </head>
    <body>
    This page has moved to <a href=”http://somacon.com/”>http://somacon.com/</a>
    </body>
    </html>

    Reference from: http://www.somacon.com/p145.php; Http/1.1 code definitions