我試圖使用谷歌分析API下載'用戶定義'變量。登錄正在工作,它正常顯示了正常的請求,但是我無法弄清楚如何提取用戶定義的變量數據。谷歌分析API和用戶定義的變量
USER_EMAIL="[email protected]" #Insert your Google Account email address here
USER_PASS="mypassword" #Insert your password here
TABLE_ID="ga:12345my_t_id" #Insert your table ID here (ie ga:1234)
googleAuth="$(curl https://www.google.com/accounts/ClientLogin -s \
-d Email=$USER_EMAIL \
-d Passwd=$USER_PASS \
-d accountType=GOOGLE \
-d source=curl-dataFeed-v2 \
-d service=analytics \
| awk /Auth=.*/)"
feedUri="https://www.google.com/analytics/feeds/data\
?ids=$TABLE_ID\
&start-date=2010-04-04\
&end-date=2011-07-07\
&dimensions=ga:source,ga:medium\
&metrics=ga:visits\
&sort=-ga:visits\
&filters=ga:medium%3D%3Dreferral\
&max-results=5\
&prettyprint=true"
curl $feedUri --silent \
--header "Authorization: GoogleLogin $googleAuth" \
--header "GData-Version: 2"
順便說一下,用戶定義的變量是完整的引用URL。
編輯:我想通了,GA:userDefinedValue採用的分析數據瀏覽器,如果你想獎勵!:
http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html
是否使用用戶定義的變量或者自定義變量?這些是兩個獨立的功能 – Yahel
用戶定義的變量:) – abcde123483
更新它反映它:) – abcde123483