Ejemplo n.º 1
0
        /// <summary>
        /// Pulls and prints the reach curve for the given request.
        /// </summary>
        /// <param name="reachPlanService">Instance of Reach Plan Service client.</param>
        /// <param name="request">An already-populated reach curve request.</param>
        public void PullReachCurve(
            ReachPlanServiceClient reachPlanService, GenerateReachForecastRequest request)
        {
            GenerateReachForecastResponse response = reachPlanService.GenerateReachForecast(
                request);

            Console.WriteLine("Reach curve output:");
            Console.WriteLine(
                "Currency,\tCost Micros,\tOn-Target Reach,\tOn-Target Imprs,\tTotal Reach," +
                "\tTotal Imprs,\tProducts");
            foreach (ReachForecast point in response.ReachCurve.ReachForecasts)
            {
                Console.Write($"{request.CurrencyCode},\t");
                Console.Write($"{point.CostMicros},\t");
                Console.Write($"{point.Forecast.OnTargetReach},\t");
                Console.Write($"{point.Forecast.OnTargetImpressions},\t");
                Console.Write($"{point.Forecast.TotalReach},\t");
                Console.Write($"{point.Forecast.TotalImpressions},\t");
                Console.Write($"\"[");
                foreach (ProductAllocation product in point.ForecastedProductAllocations)
                {
                    Console.Write($"(Product: {product.PlannableProductCode}, ");
                    Console.Write($"Budget Micros: {product.BudgetMicros}), ");
                }
                Console.WriteLine($"]\"");
            }
        }
 /// <summary>Snippet for GenerateReachForecast</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateReachForecast()
 {
     // Create client
     ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create();
     // Initialize request argument(s)
     string                       customerId       = "";
     CampaignDuration             campaignDuration = new CampaignDuration();
     IEnumerable <PlannedProduct> plannedProducts  = new PlannedProduct[]
     {
         new PlannedProduct(),
     };
     // Make the request
     GenerateReachForecastResponse response = reachPlanServiceClient.GenerateReachForecast(customerId, campaignDuration, plannedProducts);
 }
Ejemplo n.º 3
0
 /// <summary>Snippet for GenerateReachForecast</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateReachForecastRequestObject()
 {
     // Create client
     ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create();
     // Initialize request argument(s)
     GenerateReachForecastRequest request = new GenerateReachForecastRequest
     {
         CustomerId       = "",
         CampaignDuration = new CampaignDuration(),
         Targeting        = new Targeting(),
         PlannedProducts  =
         {
             new PlannedProduct(),
         },
         CookieFrequencyCapSetting = new FrequencyCap(),
         CurrencyCode          = "",
         CookieFrequencyCap    = 0,
         MinEffectiveFrequency = 0,
     };
     // Make the request
     GenerateReachForecastResponse response = reachPlanServiceClient.GenerateReachForecast(request);
 }