相关疑难解决方法(0)

Google Analytics api - 通过 URL 获取页面浏览量

我能够从谷歌分析API运行de“hello”应用程序:

function getFirstProfileId($analytics) {
    // Get the user's first view (profile) ID.

    // Get the list of accounts for the authorized user.
    $accounts = $analytics->management_accounts->listManagementAccounts();

    if (count($accounts->getItems()) > 0) {
        $items = $accounts->getItems();
        $firstAccountId = $items[0]->getId();

        // Get the list of properties for the authorized user.
        $properties = $analytics->management_webproperties
                ->listManagementWebproperties($firstAccountId);

        if (count($properties->getItems()) > 0) {
            $items = $properties->getItems();
            $firstPropertyId = $items[0]->getId();

            // Get the list of views (profiles) for the authorized user.
            $profiles = $analytics->management_profiles->listManagementProfiles($firstAccountId, $firstPropertyId);

            if (count($profiles->getItems()) > 0) …
Run Code Online (Sandbox Code Playgroud)

php api google-analytics

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

api ×1

google-analytics ×1

php ×1