/// <summary> /// Gets the realtime data from the specified profile and options. /// </summary> /// <param name="profileId">The ID of the Analytics profile.</param> /// <param name="options">The options specifying the query.</param> public string GetRealtimeData(string profileId, AnalyticsRealtimeDataOptions options) { // Validate arguments if (options == null) { throw new ArgumentNullException("options"); } // Generate the name value collection NameValueCollection query = options.ToNameValueCollection(profileId, Client.AccessToken); // Make the call to the API return(SocialUtils.DoHttpGetRequestAndGetBodyAsString("https://www.googleapis.com/analytics/v3/data/realtime", query)); }
/// <summary> /// Gets the realtime data from the specified profile and options. /// </summary> /// <param name="profile">The Analytics profile to gather realtime data from.</param> /// <param name="options">The options specifying the query.</param> public string GetRealtimeData(AnalyticsProfile profile, AnalyticsRealtimeDataOptions options) { return(GetRealtimeData(profile.Id, options)); }
/// <summary> /// Gets realtime data for the specified profile and options. /// </summary> /// <param name="profileId">The ID of the Analytics profile.</param> /// <param name="options">The options specifying the query.</param> public AnalyticsRealtimeDataResponse GetRealtimeData(string profileId, AnalyticsRealtimeDataOptions options) { return(AnalyticsRealtimeDataResponse.ParseJson(Raw.GetRealtimeData(profileId, options))); }