谷歌分析:在我的網站上顯示數據時,我可以使用自定義維度名稱而不是索引嗎 (Google analytics : Can I use custom dimension name instead of index while showing data on Report On my Site)


問題描述

谷歌分析:在我的網站上顯示數據時,我可以使用自定義維度名稱而不是索引嗎 (Google analytics : Can I use custom dimension name instead of index while showing data on Report On my Site)

我正在使用 Google Analytics API 來顯示數據。但是我的自定義維度數據會將標題顯示為

在此處輸入圖片描述

但我希望將表頭視為 SchoolName 或其他名稱,而不是自定義維度 3。

gapi.analytics.auth.authorize({ 'serverAuth': { 'access_token': token } });

                var dataChart = new gapi.analytics.googleCharts.DataChart({
                    query: {
                        'ids': 'ga:111090746',
                        metrics: 'ga:totalEvents',
                        dimensions: dimension,
                        'start‑date': '30daysAgo',
                        'end‑date': 'yesterday',
                        'filters': 'ga:eventAction==' + filter,
                        'max‑results': maxSize,
                        output: 'dataTable',
                        'totalResults': 'integer',
                    },
                    chart: {
                        container: 'declare‑career‑container',
                        type: 'TABLE',
                        options: {
                            showRowNumber: true,
                            page: 'enable',
                            pageSize: '10',
                            sortColumn: 0,
                            sortAscending: false,
                            'width': 650,
                            'height': 400,
                            'headerRow': 'header',
                        }
                    }

                });
                dataChart.on('success', function (response) {
                    var lbl = document.getElementById('totalCount');
                    lbl.textContent = response.response.totalResults;
                });
                dataChart.execute();

我怎樣才能做到這一點?


參考解法

方法 1:

You need to add the user defined column in your google analytics account

  1. Sign in to your Google Analytics account.
  2. Select the Customization tab, at the top of any page in Analytics.
  3. Select Custom Reports in the left navigation.
  4. Your reports will be listed in the left navigation under Custom Reports.
  5. If no custom reports have been created, you will only see an entry for Overview under Custom Reports.

reference: https://support.google.com/analytics/answer/1033013

(by Sparsh Kumar SaxenaPauAI)

參考文件

  1. Google analytics : Can I use custom dimension name instead of index while showing data on Report On my Site (CC BY‑SA 2.5/3.0/4.0)

#google-analytics-api #javascript






相關問題

使用C#的Google Analytics(分析)訪問 (Google Analytics Access with C#)

嘗試安裝新的 Google Analytics 3.0 Beta 時出現鏈接器錯誤 (Linker errors when trying to install new Google Analytics 3.0 Beta)

Google Analytics:數據導入和每日上傳的區別 (Google Analytics: Difference between Data Import & Daily upload)

Google Reporting API for Analytics 庫依賴項 (Google Reporting API for Analytics library dependencies)

將 Google Analytics 權限分配給整個公司域 (Assign Google Analytics Permission To Whole Company Domain)

將 google-api-client 0.9.pre3 集成到 dashing 後的 NoMethodError (NoMethodError after integrating google-api-client 0.9.pre3 in dashing)

谷歌分析:在我的網站上顯示數據時,我可以使用自定義維度名稱而不是索引嗎 (Google analytics : Can I use custom dimension name instead of index while showing data on Report On my Site)

Pandas / Google Analytics API 身份驗證嘗試給我帶來了一個奇怪的 python 錯誤 (Pandas / Google Analytics API authentication attempt throws me a weird python error)

如何訪問行為流數據?(在應用程序 Google Analytics 帳戶上。) (How to access Behavior Flow data? (on a Application Google Analytics Account.))

如何在 Google Analytics 的一份報告中單獨細分指標? (How to individually segment metrics in one report in Google Analytics?)

Python - 問題使用循環每天得到 (Python - Problem use loops to get day by day)

我想要在 PHP 中使用 orderBy 和 Filters 的 Google Analytics Data API (GA4) 示例代碼 (I want a sample code for Google Analytics Data API (GA4) in PHP using orderBy and Filters)







留言討論