public Experiment(GoogleExperiment experiment) { GoogleExperiment = experiment; if (TryParseUSplitExperimentName(experiment.Name, out var nodeId, out var name)) { IsUSplitExperiment = true; Name = name; ServerSide = nodeId == -1; Configuration = ParseSettings(experiment.Description); }
private static List <Variation> ParseVariations(GoogleExperiment experiment) { //we might not be executing this in the scope of a http request var contentService = ApplicationContext.Current.Services.ContentService; var variations = new List <Variation>(); foreach (var variation in experiment.Variations) { IContent content = null; int variationNodeId; if (int.TryParse(variation.Url, out variationNodeId)) { content = contentService.GetById(variationNodeId); } variations.Add(new Variation { VariedContent = content, GoogleVariation = variation, }); } return(variations); }
public static ManagementResource.ExperimentsResource.PatchRequest Patch(this ManagementResource.ExperimentsResource experiments, AnalyticsAccount config, GoogleExperiment experiment) { var accountId = config.GoogleAccountId; var webPropertyId = config.GoogleWebPropertyId; var profileId = config.GoogleProfileId; return(experiments.Patch(experiment, accountId, webPropertyId, profileId, experiment.Id)); }
private void ParseGoogleData(GoogleExperiment experiment) { Configuration = ParseSettings(experiment.Description); Variations = ParseVariations(experiment); }
public Experiment(GoogleExperiment experiment) { GoogleExperiment = experiment; ParseGoogleData(experiment); }
public static ManagementResource.ExperimentsResource.InsertRequest Insert(this ManagementResource.ExperimentsResource experiments, AccountConfig config, GoogleExperiment experiment) { var accountId = config.GoogleAccountId; var webPropertyId = config.GoogleWebPropertyId; var profileId = config.GoogleProfileId; return(experiments.Insert(experiment, accountId, webPropertyId, profileId)); }