Social Sort Manager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private DataResource.GaResource.GetRequest GetRequest(AnalyticsService service) | |
{ | |
// format the profile id | |
var profileId = _settings.GoogleAnalyticsProfileId; | |
if (!profileId.Contains("ga:")) | |
profileId = string.Format("ga:{0}", profileId); | |
var window = _settings.WindowInDays; | |
var startDate = DateTime.Now.AddDays(-window); | |
var endDate = DateTime.Now; | |
var request = service.Data.Ga.Get(profileId, startDate.ToString("yyyy-MM-dd"), endDate.ToString("yyyy-MM-dd"), "ga:pageviews,ga:socialInteractions"); | |
request.Dimensions = "ga:pageTitle"; | |
return request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment