- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用示例 code来自 GitHub。
#region code
AnalyticsService service;
// Service account Authentication
String SERVICE_ACCOUNT_EMAIL =" ";// removed the account email
string SERVICE_ACCOUNT_KEYFILE = @"C:\Projects\Test\TMBWebsite-7f016e7c3562.p12";
service = DaimtoAnalyticsAuthenticationHelper.AuthenticateServiceAccount(SERVICE_ACCOUNT_EMAIL,SERVICE_ACCOUNT_KEYFILE);
//////Get account summary and display them.
foreach (AccountSummary account in DaimtoAnaltyicsManagmentHelper.AccountSummaryList(service).Items)
{
// Account
Console.WriteLine("Account: " + account.Name + "(" + account.Id + ")");
foreach (WebPropertySummary wp in account.WebProperties)
{
// Web Properties within that account
Console.WriteLine("\tWeb Property: " + wp.Name + "(" + wp.Id + ")");
//Don't forget to check its not null. Believe it or not it could be.
if (wp.Profiles != null)
{
foreach (ProfileSummary profile in wp.Profiles)
{
// Profiles with in that web property.
Console.WriteLine("\t\tProfile: " + profile.Name + "(" + profile.Id + ")");
}
}
}
}
#endregion
//认证服务
if (!File.Exists(keyFilePath))
{
Console.WriteLine("An Error occurred - Key file does not exist");
return null;
}
string[] scopes = new string[] { AnalyticsService.Scope.Analytics, // view and manage your analytics data
AnalyticsService.Scope.AnalyticsEdit, // edit management actives
AnalyticsService.Scope.AnalyticsManageUsers, // manage users
AnalyticsService.Scope.AnalyticsReadonly}; // View analytics data
X509Certificate2 certificate = new X509Certificate2(keyFilePath, "notasecret", X509KeyStorageFlags.Exportable);
// X509Certificate2 certificate = new X509Certificate2(keyFilePath, "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
try
{
ServiceAccountCredential credential = new ServiceAccountCredential(
new ServiceAccountCredential.Initializer(serviceAccountEmail)
{
Scopes = scopes
}.FromCertificate(certificate));
// Create the service.
AnalyticsService service = new AnalyticsService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Analytics API Sample",
});
return service;
}
catch (Exception ex)
{
Console.WriteLine(ex.InnerException);
return null;
}
#region 帐户摘要
/// <summary>
/// Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access.
/// Documentation: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/accountSummaries/list
/// </summary>
/// <param name="service">Valid authenticated Analytics Service</param>
/// <returns>List of Account Summaries resource - https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/accountSummaries</returns>
public static AccountSummaries AccountSummaryList(AnalyticsService service)
{
//List all of the activities in the specified collection for the current user.
// Documentation: https://developers.google.com/+/api/latest/activities/list
//ManagementResource.AccountSummariesResource.ListRequest list = service.Management.AccountSummaries.List();
ManagementResource.AccountSummariesResource.ListRequest list = service.Management.AccountSummaries.List();
list.Alt = ManagementResource.AccountSummariesResource.ListRequest.AltEnum.Json;
list.MaxResults = 1000; // Maximum number of Account Summaries to return per request.
AccountSummaries feed = list.Execute();
List<AccountSummary> allRows = new List<AccountSummary>();
//var getRequest = settingsService.Groups.Get("samplegroup@example.com");
//getRequest.Alt = "json";
//var settings = getRequest.Execute();
//// Loop through until we arrive at an empty page
while (feed.Items != null)
{
allRows.AddRange(feed.Items);
// We will know we are on the last page when the next page token is
// null.
// If this is the case, break.
if (feed.NextLink == null)
{
break;
}
// Prepare the next page of results
list.StartIndex = feed.StartIndex + list.MaxResults;
// Execute and process the next page request
feed = list.Execute();
}
feed.Items = allRows;
return feed;
}
#endregion
AccountSummaries feed = list.Execute();抛出异常:{“解析值时遇到意外字符:<。路径'',第0行,位置0。”}在谷歌分析api中
最佳答案
我想通了。防火墙阻止了我的请求。在我的配置文件中添加了下面给定的代码并且工作了 <system.net> <defaultProxy useDefaultCredentials="true"> <proxy proxyaddress="My proxy address here" usesystemdefault="True"/> </defaultProxy> </system.net>
关于google-analytics-api - {"Unexpected character encountered while parsing value: <. Path ' ', line 0, position 0."} in google analytics api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30565438/
最近,我收到了一个项目要求,即从某个页面将数据发送到Google Analytics(分析)。我不知道该怎么做。 帐户ID和所有内容均已创建,我只想知道如何在加载某个网页时发送数据。 我一直在根据自己
我试图在此站点和其他一些站点上找到此问题的答案。但这似乎并不适合我自己。以下网址显示了有关如何同时使用GA和UA的说明。 How to use both ga.js and analytics.js?
从谷歌的文档: The analytics.js snippet is part of Universal Analytics, which is currently in public beta.
根据google的新analytics.js文档,您可以设置多个跟踪器,并通过在单独的send调用中按名称明确提及跟踪器来向其发送事件: https://developers.google.com/a
有什么办法可以让 Google Analytics 的“In-Page Analytics”显示外部链接流量? 实际上,外部链接的综合浏览量会显示在流量报告中,但不会显示在页内分析中。 我们正在使用这
我正在尝试编写一个 Google Analytics API 查询,它只返回去年每个月的每月唯一身份访问者。 This is the data I see in the Google Analytic
我们在我们的应用程序中使用 Google Analytics,但现在我们需要更改它并改用 Adobe Analytics。 在对这两种工具进行比较研究时,我现在意识到了这两种工具的优缺点和特点,
我需要您有关 Google Analytics (analytics.js) 的帮助。我在头部有第一个通用部分,效果很好: (function(i,s,o,g,r,a,m
这个问题在这里已经有了答案: Why use protocol-relative URLs at all? (5 个答案) 关闭 5 年前。 我正在阅读 https://developers.goo
将目标从Analytics(分析)导入到AdWords中,然后在Analytics(分析)中更改目标条件时,是否可以通过更改将目标“重新导入”到AdWords,还是可以自动选择? 最佳答案 更改目标值
Google最近更新了他们对开发人员的政策。 https://play.google.com/about/privacy-security/personal-sensitive/ If your ap
我正在使用google analytics api来获取数据。我正在获取数据,但我想验证两个参数,它们在特定日期范围内始终为0。我正在获取['ga:transactions']和['ga:goalCo
我使用Google API从Google Analytics(分析)获取数据,但指标与Google Analytics(分析)的网络界面不同。 即:我在2015年3月1日获得数据-它返回综合浏览量79
我安装了 Google Analytics (UA) 并将跟踪代码添加到 html 页面。我从浏览器文件中运行 html 页面:///C:/test.html 并使用谷歌调试器进行调试,它成功运行并显
我正在遵循 https://developers.google.com/analytics/devguides/collection/amp-analytics/ 的简单指南 尝试添加 Pagevie
我计划管理大约。通过为每个属性创建带有主机名过滤器的专用 View ,可以在一个属性下创建 400 个差异站点。是否有任何流程可以在不手动创建 View 和制作过滤器的情况下完成此任务? 例如:我们有
我想使用 Google Analytics API 访问 User Explorer 数据,以获取 JSON 值形式的报告。使用此 JSON 值,我可以创建用于分析的 Web 应用程序仪表板。我在此
我正在尝试使用此代码来跟踪 Google Analytics 中的事件 _trackEvent(category, action, opt_label, opt_value, opt_noni
我目前正在使用访问 token 和刷新 token 从 Google Analytics Reporting API (v4) 中提取数据。当我致力于自动从 Google Analytics 中提取数
我正在尝试根据此相关问题实现 anchor (index.html#anchor)跟踪: How to track anchor tags with Google Analytics 我使用 anch
我是一名优秀的程序员,十分优秀!