Dịch vụ Analytics cho phép bạn sử dụng công cụ Google Analytics API Quản lý và API Báo cáo trong Apps Script. Các API này cung cấp cho người dùng Analytics khả năng nhận thông tin về cấu trúc của tài khoản và chạy báo cáo về hiệu suất của quảng cáo.
Tài liệu tham khảo
Để biết thông tin chi tiết về dịch vụ này, hãy xem tài liệu tham khảo cho nhiều API của Google Analytics:
- API Báo cáo chính
- API Quản lý
- API Siêu dữ liệu
- API Báo cáo phễu đa kênh
- API Báo cáo theo thời gian thực
Giống như tất cả các dịch vụ nâng cao trong Apps Script, dịch vụ Analytics sử dụng các đối tượng, phương thức và tham số giống như API công khai. Để biết thêm thông tin, hãy xem bài viết Cách xác định chữ ký phương thức.
Để báo cáo sự cố và tìm hỗ trợ khác, hãy xem các trang hỗ trợ tương ứng:
- Hỗ trợ Core Reporting API
- Hỗ trợ API Quản lý
- Hỗ trợ API siêu dữ liệu
- Hỗ trợ API Báo cáo phễu đa kênh
- Hỗ trợ API Báo cáo theo thời gian thực
Mã mẫu
Mã mẫu bên dưới phiên bản 3 của API Quản lý.
Liệt kê cấu trúc tài khoản
Mẫu này liệt kê tất cả tài khoản Google Analytics, tài sản web và hồ sơ mà người dùng hiện tại có thể truy cập.
Chạy báo cáo
Mẫu này chạy báo cáo để truy xuất 25 từ khoá và nguồn lưu lượng truy cập hàng đầu và lưu trữ kết quả trong một bảng tính mới.