gpt4 book ai didi

google-analytics - 实时衡量网站访问和页面浏览量的最佳方法是什么?

转载 作者:行者123 更新时间:2023-12-03 16:06:56 25 4
gpt4 key购买 nike

我目前使用Adobe Omniture SiteCatalyst,Google Analytics(分析)和New Relic。这三个指标均提供访问量和浏览量指标。 SiteCatalyst没有我所知道的API,并且它们的数据通常落后几个小时。 Google Analytics(分析)和New Relic都提供了实时API,但我发现所提供的指标在各供应商之间差异很大。

衡量实时访问(页面浏览量,唯一身份访问者等)的最佳方法(API)是什么?

最终,我打算使用这些数据向我的商业客户展示实时转化率。

最佳答案

Adobe SiteCatalyst确实具有可以使用的实时API。它的功能类似于SiteCatalyst工作中的报告。

这是python示例请求:

import requests
import sha
import binascii
import time

your_report_suite="ReportSuiteId" #The name of the report suite
what_you_are_looking = "someValue" #value of a the prop that you want to find in the realtime stream

def getRealTimeUsers():
if mobile:
url = 'https://api.omniture.com/admin/1.3/rest/?method='
headers = {'X-WSSE': self.generateHeader()}
method = 'Report.GetRealTimeReport'
report_url = url + method
payload = {
"reportDescription": {
"reportSuiteID": your_report_suite,
"metrics": [
{
"id": "instances"
}
],
"elements": [
{
"id": "prop4",
"search": {
"type": "string",
"keywords": what_you_are_looking
}
}

]
}
}
response = requests.post(url=report_url, headers=headers, data=json.dumps(payload))
data = response.json().get('report').get('data')

def generateHeader():
# Generates the SC headers for the request
nonce = str(time.time())
base64nonce = binascii.b2a_base64(binascii.a2b_qp(nonce))
created_date = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.localtime())
sha_object = sha.new(nonce + created_date + self.sc_key)
password_64 = binascii.b2a_base64(sha_object.digest())

return 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"' % (
self.sc_user, password_64.strip(), base64nonce.strip(), created_date)


注意:实时报告要求在报告套件中打开实时功能。实时报告的维度也受到限制。关于所需的特定请求,没有很多文档,但是有: https://marketing.adobe.com/developer/documentation/sitecatalyst-reporting/c-real-time

另外,我强烈建议您使用api资源管理器进行实验: https://marketing.adobe.com/developer/api-explorer#Report.GetRealTimeReport

关于google-analytics - 实时衡量网站访问和页面浏览量的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12135475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com