/// <summary>Snippet for GenerateProductMixIdeas</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateProductMixIdeas()
 {
     // Create client
     ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create();
     // Initialize request argument(s)
     string customerId          = "";
     string plannableLocationId = "";
     string currencyCode        = "";
     long   budgetMicros        = 0L;
     // Make the request
     GenerateProductMixIdeasResponse response = reachPlanServiceClient.GenerateProductMixIdeas(customerId, plannableLocationId, currencyCode, budgetMicros);
 }
Example #2
0
 /// <summary>Snippet for GenerateProductMixIdeas</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GenerateProductMixIdeasRequestObject()
 {
     // Create client
     ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create();
     // Initialize request argument(s)
     GenerateProductMixIdeasRequest request = new GenerateProductMixIdeasRequest
     {
         CustomerId          = "",
         Preferences         = new Preferences(),
         PlannableLocationId = "",
         CurrencyCode        = "",
         BudgetMicros        = 0L,
     };
     // Make the request
     GenerateProductMixIdeasResponse response = reachPlanServiceClient.GenerateProductMixIdeas(request);
 }
        /// <summary>
        /// Pulls a forecast for a product mix suggested based on preferences for whether the ad
        /// would have a guaranteed price, play with sound, would be skippable, would include top
        /// content, and a desired ad length.
        /// </summary>
        /// <param name="reachPlanService">Instance of Reach Plan Service client.</param>
        /// <param name="customerId">The customer ID for the reach forecast.</param>
        /// <param name="locationId">Location ID to plan for. To find a valid locaction ID, either
        /// see https://developers.google.com/adwords/api/docs/appendix/geotargeting or call
        /// <see cref="ReachPlanServiceClient.ListPlannableLocations"/>.</param>
        /// <param name="currencyCode">Three-character ISO 4217 currency code.</param>
        /// <param name="budgetMicros">Budget in currency micro-units to plan for.</param>
        public void ForecastSuggestedMix(
            ReachPlanServiceClient reachPlanService,
            string customerId,
            string locationId,
            string currencyCode,
            long budgetMicros)
        {
            // Note: If preferences are too restrictive, then the response will be empty.
            Preferences preferences = new Preferences()
            {
                HasGuaranteedPrice = true,
                StartsWithSound    = true,
                IsSkippable        = false,
                TopContentOnly     = true,
                AdLength           = ReachPlanAdLength.FifteenOrTwentySeconds
            };

            GenerateProductMixIdeasRequest mixRequest = new GenerateProductMixIdeasRequest()
            {
                BudgetMicros        = Convert.ToInt64((double)budgetMicros),
                CurrencyCode        = currencyCode,
                CustomerId          = customerId,
                PlannableLocationId = locationId,
                Preferences         = preferences
            };

            GenerateProductMixIdeasResponse mixResponse =
                reachPlanService.GenerateProductMixIdeas(mixRequest);

            List <PlannedProduct> productMix = new List <PlannedProduct>();

            foreach (ProductAllocation product in mixResponse.ProductAllocation)
            {
                productMix.Add(
                    new PlannedProduct()
                {
                    PlannableProductCode = product.PlannableProductCode,
                    BudgetMicros         = product.BudgetMicros
                });
            }

            GenerateReachForecastRequest curveRequest =
                BuildReachRequest(customerId, productMix, locationId, currencyCode);

            PullReachCurve(reachPlanService, curveRequest);
        }