結果,可以 ^____^ !
◎ 夥伴們可先參考這裡跟這裡的文章,知曉 Google Analytics 與 Google App Engine 的一些初步申請與建置說明。
[實作環境]
1. Windows XP SP3
2. Eclipse 3.4.1 (GANYMEDE)
3. Google App Engine SDK for Eclipse 3.4
4. 已申請 Google Analytics 使用者帳號
[實作步驟]
Step 1. 登入 Google Analytics 網站,並點選左下的「建立新網站設定」。
Step 2. 建立新網站設定檔內的資料,並點選「完成」。
Step 3. 抓下(COPY) Analytics 給予的追蹤程式碼。
Step 4. 將追蹤程式碼填入要發佈到 Google App Engine 的程式中,記得要放在 </body> 之前!
Step 5. 將程式重新發佈到 Google App Engine。
Step 6. 在 Google Analytics 上點選「儲存並完成」。
Step 7. 過幾分鐘後再點選 Google Analytics 主頁右邊的「編輯」看看。
Step 8. 如還是顯示「追蹤尚未安裝」,試著點選「檢查狀態」,強迫 Analytics 再次檢查已發佈到 App Engine 上的程式碼生效沒。
Step 9. 一般來說,如上述步驟無誤,約 3 到 10 分鐘後,Analytics 主頁將會顯示「資料接收中」,然後約莫過了 12 到 24 小時,就可看 Analytics 分析表了。
◎ 如何將發佈到 Google App Engine 上的行動網頁塞到 Android 程式內,夥伴們可參考這裡,使用 WebView 將 AdSense 加 入行動網頁 的作法,改建個空的行動網頁,並用 WebView 將之隱入 Android 程式的小小角落中。怎樣隱入?請參考以下在 layout 的 main.xml 中的程式碼:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center">
<AbsoluteLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/myImageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"
></ImageView>
android:id="@+id/myImageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"
></ImageView>
</AbsoluteLayout>
<WebView
android:id="@+id/myWebView01"
android:layout_width="fill_parent"
android:layout_height="0px"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
板大你好~
回覆刪除想跟你請教一下google analytic的用法, 我想要用來分析我自己開發的Android app(已上架), 所以我必須要在程式的onCreate裡面做些事情, 相關文章都有提到, 但我很不解的是tracker.trackPageView("參數")裡面的參數到底要給甚麼? 我是已經有註冊analytic的帳號和設定好一些設定檔, 我知道設定檔的名字可以是一個假的網頁, 他應該只是一個名字對應到UA-xxx-xx, 但是這個名字和上述的參數有關嗎? 期待你的解惑, 最好能舉個例子 哈~謝啦
Qiss 您好!漁郎目前還沒用過 Analytics SDK 喔!僅有使用網頁式 Analytics scripts,其優點是隨時可換用 Analytics 參數而不用更動已發行的 APP,缺點是分析的功能就沒 Analytics SDK 多了,改天漁郎有空玩到 Analytics SDK 時再研究囉,或許網友會比漁郎早先有答案哩!^_^
回覆刪除