সম্পদ তৈরি করুন

লাইন আইটেমগুলির অনেকগুলি মূল সংস্থান রয়েছে যেগুলি থেকে তারা সেটিংস এবং লক্ষ্য নির্ধারণের উত্তরাধিকারী হয়৷ Display & Video 360 API ব্যবহার করে এই সম্পদগুলির বেশিরভাগই তৈরি করা, পুনরুদ্ধার করা এবং আপডেট করা যায়। এই পৃষ্ঠাটি সম্পদের শ্রেণিবিন্যাস বর্ণনা করে এবং Display & Video 360 API ব্যবহার করে কীভাবে এই সম্পদগুলি তৈরি করতে হয় তার উদাহরণ দেয়।

সম্পদ শ্রেণিবিন্যাস

সম্পদ শ্রেণিবিন্যাস চিত্র

Display & Video 360-এ, সংস্থানগুলির একটি শ্রেণিবিন্যাস রয়েছে যার সেটিংস বিজ্ঞাপন পরিবেশনকে প্রভাবিত করে৷ প্রতিটি সম্পদের বিজ্ঞাপন পরিবেশনের একটি স্বতন্ত্র উদ্দেশ্য আছে। সর্বনিম্ন অনুক্রমিক স্তর থেকে শুরু:

  • লাইন আইটেমগুলি এমন সংস্থান যা নিয়ন্ত্রণ করে কোন বিজ্ঞাপনগুলি পরিবেশিত হয়, কখন সেগুলি পরিবেশিত হয় এবং কাকে সেগুলি পরিবেশন করা হয়৷
    • YouTube এবং অংশীদারদের লাইন আইটেমগুলিতে অ্যাড গ্রুপ এবং বিজ্ঞাপন চাইল্ড রিসোর্সও রয়েছে৷ তারা একটি একক লাইন আইটেম বাজেটের অধীনে লক্ষ্যমাত্রার অতিরিক্ত স্তর প্রদান করে। YouTube এবং অংশীদারদের লাইন আইটেম, বিজ্ঞাপন গোষ্ঠী, বিজ্ঞাপন এবং তাদের টার্গেটিং API ব্যবহার করে সম্পাদনা করা যাবে না।
  • সন্নিবেশ আদেশ একাধিক লাইন আইটেম আছে. তারা অনুপস্থিত লাইন আইটেম সেটিংসের জন্য ডিফল্ট মান প্রদান করে।
  • প্রচারাভিযানে একাধিক সন্নিবেশ আদেশ রয়েছে। তারা তাদের সন্নিবেশ আদেশে সেটিংস প্রয়োগ করে না। তাদের সেটিংস একটি ফ্রেমিং হিসাবে কাজ করে যার দ্বারা তাদের অধীনে পরিবেশিত বিজ্ঞাপনগুলির অগ্রগতি এবং সাফল্য পরিমাপ করা হয়।
  • বিজ্ঞাপনদাতারা একাধিক বিজ্ঞাপন প্রচারের মালিক। তারা তাদের অধীনে পরিবেশিত বিজ্ঞাপনগুলিতে ব্র্যান্ড নিরাপত্তা লক্ষ্য এবং অন্যান্য সাধারণ সেটিংস প্রয়োগ করে। তারা এটির অধীনে পরিবেশিত বিজ্ঞাপনগুলিতে ব্যবহৃত সৃজনশীল বস্তুর মালিক এবং লক্ষ্যবস্তুতে ব্যবহৃত সংস্থানগুলিতে অ্যাক্সেস সরবরাহ করে।
  • অংশীদাররা একাধিক বিজ্ঞাপনদাতার মালিক। তারা সেই বিজ্ঞাপনদাতাদের উপর আরও ব্র্যান্ড নিরাপত্তা টার্গেটিং এবং অন্যান্য সেটিংস প্রয়োগ করে৷ তারা রূপান্তর ট্র্যাকিং এ ব্যবহৃত টার্গেটিং এবং ফ্লাডলাইট কার্যকলাপে ব্যবহৃত সংস্থানগুলিতে অ্যাক্সেস সরবরাহ করে। অংশীদারদের API এর মাধ্যমে সম্পাদনা করা যাবে না।

উত্তরাধিকার

লাইন আইটেমগুলি তাদের মূল সংস্থানগুলি থেকে অসংখ্য সেটিংস এবং অ্যাক্সেসের উত্তরাধিকারী হয়৷ লাইন আইটেম এবং বিজ্ঞাপন পরিবেশন পরিচালনা করার সময়, উত্তরাধিকারসূত্রে প্রাপ্ত গুণাবলী বিবেচনা করতে হবে:

  • উপলব্ধ ক্রিয়েটিভ এবং ফ্লাডলাইট ক্রিয়াকলাপ: লাইন আইটেমগুলির কেবলমাত্র তাদের পিতামাতার অংশীদার বা বিজ্ঞাপনদাতাদের মালিকানাধীন সংস্থানগুলিতে অ্যাক্সেস রয়েছে৷ ক্রিয়েটিভগুলি বিজ্ঞাপনদাতাদের অধীনে তৈরি করা হয় এবং ফ্লাডলাইট কার্যক্রম অংশীদারদের মালিকানাধীন। LineItem রিসোর্স ক্ষেত্রের creativeIds এবং conversionCounting বরাদ্দ করা সংস্থানগুলিকে অবশ্যই একই অভিভাবক বিজ্ঞাপনদাতা এবং অংশীদারকে যথাক্রমে ভাগ করতে হবে৷
  • অ্যাক্সেসযোগ্য লক্ষ্যযোগ্য সত্তা: চ্যানেল , সম্মিলিত শ্রোতা এবং অন্যান্যের মতো সংস্থানগুলি লক্ষ্যে ব্যবহার করা হয়। লাইন আইটেমগুলি শুধুমাত্র তার মূল অংশীদার বা বিজ্ঞাপনদাতার কাছে অ্যাক্সেসযোগ্য সংস্থানগুলি ব্যবহার করে লক্ষ্যবস্তু করা যেতে পারে৷
  • ব্র্যান্ড নিরাপত্তা টার্গেটিং: লাইন আইটেমগুলি অংশীদার এবং বিজ্ঞাপনদাতা স্তরে লক্ষ্য নির্ধারণের উত্তরাধিকারী হয়৷ উত্তরাধিকারসূত্রে প্রাপ্ত টার্গেটিং সরানো যাবে না। এই বিদ্যমান টার্গেটিং একটি নির্ধারিত টার্গেটিং বিকল্পের inheritance ক্ষেত্র দ্বারা চিহ্নিত করা যেতে পারে এবং পরবর্তী টার্গেটিং প্রয়োগ করা যেতে পারে তা প্রভাবিত করবে।

সম্পদ তৈরি করুন

উপরে তালিকাভুক্ত সমস্ত সংস্থান প্রদর্শন এবং ভিডিও 360 API ব্যবহার করে পরিচালনা করা যেতে পারে। প্রদত্ত ক্লায়েন্ট লাইব্রেরি ব্যবহার করে কীভাবে এই প্রতিটি সংস্থান তৈরি করতে হয় তার সহজ কোড উদাহরণ নীচে দেওয়া হল।

একটি বিজ্ঞাপনদাতা তৈরি করুন

কিভাবে একটি বিজ্ঞাপনদাতা তৈরি করতে হয় তার একটি উদাহরণ এখানে দেওয়া হল:

জাভা

// Create an advertiser object.
Advertiser advertiser = new Advertiser();
advertiser.setPartnerId(partner-id);
advertiser.setDisplayName(display-name);
advertiser.setEntityStatus("ENTITY_STATUS_ACTIVE");

// Create and set the advertiser general configuration.
AdvertiserGeneralConfig advertiserGeneralConfig = new AdvertiserGeneralConfig();
advertiserGeneralConfig.setDomainUrl(domain-url);
advertiserGeneralConfig.setCurrencyCode("USD");
advertiser.setGeneralConfig(advertiserGeneralConfig);

// Create the ad server configuration structure.
AdvertiserAdServerConfig advertiserAdServerConfig = new AdvertiserAdServerConfig();

// Create and add the third party only configuration to the ad server
// configuration.
advertiserAdServerConfig.setThirdPartyOnlyConfig(new ThirdPartyOnlyConfig());

// Set the ad server configuration.
advertiser.setAdServerConfig(advertiserAdServerConfig);

// Create and set the creative configuration.
advertiser.setCreativeConfig(new AdvertiserCreativeConfig());

// Create and set the billing configuration.
AdvertiserBillingConfig advertiserBillingConfig = new AdvertiserBillingConfig();
advertiserBillingConfig.setBillingProfileId(billing-profile-id);
advertiser.setBillingConfig(advertiserBillingConfig);

// Configure the create request.
Advertisers.Create request = service.advertisers().create(advertiser);

// Create the advertiser.
Advertiser response = request.execute();

// Display the new advertiser.
System.out.printf("Advertiser %s was created.", response.getName());

পাইথন

# Create an advertiser object.
advertiser_obj = {
    'partnerId': partner-id,
    'displayName': display-name,
    'entityStatus': "ENTITY_STATUS_ACTIVE",
    'generalConfig': {
        'domainUrl' : domain-url,
        'currencyCode' : 'USD'
    },
    'adServerConfig': {
        'thirdPartyOnlyConfig' : {}
    },
    'creativeConfig': {},
    'billingConfig': {
        'billingProfileId' : billing-profile-id
    }
}

# Create the advertiser.
advertiser = service.advertisers().create(
    body=advertiser_obj
).execute()

# Display the new advertiser.
print("Advertiser %s was created." % advertiser["name"])

পিএইচপি

// Create an advertiser object.
$advertiser = new Google_Service_DisplayVideo_Advertiser();
$advertiser->setPartnerId(partner-id);
$advertiser->setDisplayName(display-name);
$advertiser->setEntityStatus('ENTITY_STATUS_ACTIVE');

// Create and set the advertiser general configuration.
$generalConfig =
    new Google_Service_DisplayVideo_AdvertiserGeneralConfig();
$generalConfig->setDomainUrl(domain-url);
$generalConfig->setCurrencyCode('USD');
$advertiser->setGeneralConfig($generalConfig);

// Create the ad server configuration structure.
$adServerConfig =
    new Google_Service_DisplayVideo_AdvertiserAdServerConfig();

// Create and add the third party only configuration to the ad server
// configuration.
$adServerConfig->setThirdPartyOnlyConfig(
    new Google_Service_DisplayVideo_ThirdPartyOnlyConfig()
);

// Set the ad server configuration.
$advertiser->setAdServerConfig($adServerConfig);

// Create and set the creative configuration.
$advertiser->setCreativeConfig(
    new Google_Service_DisplayVideo_AdvertiserCreativeConfig()
);

// Create and set the billing configuration.
$billingConfig = new Google_Service_DisplayVideo_AdvertiserBillingConfig();
$billingConfig->setBillingProfileId(billing-profile-id);
$advertiser->setBillingConfig($billingConfig);

// Call the API, creating the advertiser.
$result = $this->service->advertisers->create($advertiser);

printf('Advertiser %s was created.\n', $result['name']);

একটি প্রচারাভিযান তৈরি করুন

কিভাবে একটি প্রচারাভিযান তৈরি করতে হয় তার একটি উদাহরণ এখানে দেওয়া হল:

জাভা

// Create a campaign object.
Campaign campaign = new Campaign();
campaign.setDisplayName(display-name);
campaign.setEntityStatus("ENTITY_STATUS_PAUSED");

// Create a campaign goal object.
CampaignGoal campaignGoal = new CampaignGoal();
campaignGoal.setCampaignGoalType("CAMPAIGN_GOAL_TYPE_BRAND_AWARENESS");

// Create and add a performance goal to the campaign goal object.
PerformanceGoal performanceGoal = new PerformanceGoal();
performanceGoal.setPerformanceGoalType("PERFORMANCE_GOAL_TYPE_CPC");
performanceGoal.setPerformanceGoalAmountMicros(1000000L);
campaignGoal.setPerformanceGoal(performanceGoal);

// Set the campaign goal.
campaign.setCampaignGoal(campaignGoal);

// Create a campaign flight object.
// This object details the planned spend and duration of the campaign.
CampaignFlight campaignFlight = new CampaignFlight();
campaignFlight.setPlannedSpendAmountMicros(1000000L);

// Create the date range for the campaign flight.
DateRange dateRange = new DateRange();

// Set the start date to one week from now and the end date to two weeks
// from now.
Calendar calendarStartDate = Calendar.getInstance().add(Calendar.DATE, 7);
Calendar calendarEndDate = Calendar.getInstance().add(Calendar.DATE, 14);
dateRange.setStartDate(
   new Date()
      .setYear(calendarStartDate.get(Calendar.YEAR))
      .setMonth(calendarStartDate.get(Calendar.MONTH))
      .setDay(calendarStartDate.get(Calendar.DAY_OF_MONTH)));
dateRange.setEndDate(
   new Date()
      .setYear(calendarEndDate.get(Calendar.YEAR))
      .setMonth(calendarEndDate.get(Calendar.MONTH))
      .setDay(calendarEndDate.get(Calendar.DAY_OF_MONTH)));

// Add the planned date range to the campaign flight object.
campaignFlight.setPlannedDates(dateRange);

// Set the campaign flight.
campaign.setCampaignFlight(campaignFlight);

// Create and set the frequency cap.
FrequencyCap frequencyCap = new FrequencyCap();
frequencyCap.setMaxImpressions(10);
frequencyCap.setTimeUnit("TIME_UNIT_DAYS");
frequencyCap.setTimeUnitCount(1);
campaign.setFrequencyCap(frequencyCap);

// Configure the create request.
Campaigns.Create request = service.advertisers().campaigns()
   .create(advertiser-id, campaign);

// Create the campaign.
Campaign response = request.execute();

// Display the new campaign.
System.out.printf("Campaign %s was created.", response.getName());

পাইথন

# Create a future campaign flight start and end dates.
startDate = date.today() + timedelta(days=7)
endDate = date.today() + timedelta(days=14)

# Create a campaign object.
campaign_obj = {
    'displayName': display-name,
    'entityStatus': 'ENTITY_STATUS_PAUSED',
    'campaignGoal': {
        'campaignGoalType' : 'CAMPAIGN_GOAL_TYPE_BRAND_AWARENESS',
        'performanceGoal': {
            'performanceGoalType': 'PERFORMANCE_GOAL_TYPE_CPC',
            'performanceGoalAmountMicros': 1000000
        }
    },
    'campaignFlight': {
        'plannedSpendAmountMicros': 1000000,
        'plannedDates': {
            'startDate': {
                'year': startDate.year,
                'month': startDate.month,
                'day': startDate.day
            },
            'endDate': {
                'year': endDate.year,
                'month': endDate.month,
                'day': endDate.day
            }
        }
    },
    'frequencyCap': {
        'maxImpressions': 10,
        'timeUnit': 'TIME_UNIT_DAYS',
        'timeUnitCount': 1
    }
}

# Create the campaign.
campaign = service.advertisers().campaigns().create(
    advertiserId=advertiser-id,
    body=campaign_obj
).execute()

# Display the new campaign.
print("Campaign %s was created." % campaign["name"])

পিএইচপি

// Create a campaign object.
$campaign = new Google_Service_DisplayVideo_Campaign();
$campaign->setDisplayName(display-name);
$campaign->setEntityStatus('ENTITY_STATUS_ACTIVE');

// Create a campaign goal object.
$campaignGoal = new Google_Service_DisplayVideo_CampaignGoal();
$campaignGoal->setCampaignGoalType(
    'CAMPAIGN_GOAL_TYPE_BRAND_AWARENESS'
);

// Create and add a performance goal to the campaign goal object.
$performanceGoal = new Google_Service_DisplayVideo_PerformanceGoal();
$performanceGoal->setPerformanceGoalType('PERFORMANCE_GOAL_TYPE_CPC');
$performanceGoal->setPerformanceGoalAmountMicros(1000000);

// Set the campaign goal.
$campaignGoal->setPerformanceGoal($performanceGoal);
$campaign->setCampaignGoal($campaignGoal);

// Create a campaign flight object.
// This object details the planned spend and duration of the campaign.
$campaignFlight = new Google_Service_DisplayVideo_CampaignFlight();
$campaignFlight->setPlannedSpendAmountMicros(1000000);

// Create a date range object for the flight.
$dateRange = new Google_Service_DisplayVideo_DateRange();

// Create and assign a start date one week from now.
$startDateTime = new DateTime('today + 7 days');
$startDate = new Google_Service_DisplayVideo_Date();
$startDate->setYear($startDateTime->format('Y'));
$startDate->setMonth($startDateTime->format('n'));
$startDate->setDay($startDateTime->format('j'));
$dateRange->setStartDate($startDate);

// Create and assign an end date two weeks from now.
$endDateTime = new DateTime('today + 14 days');
$endDate = new Google_Service_DisplayVideo_Date();
$endDate->setYear($endDateTime->format('Y'));
$endDate->setMonth($endDateTime->format('n'));
$endDate->setDay($endDateTime->format('j'));
$dateRange->setendDate($endDate);

// Assign date range to flight.
$campaignFlight->setPlannedDates($dateRange);

// Assign flight to campaign.
$campaign->setCampaignFlight($campaignFlight);

// Create and set the frequency cap.
$frequencyCap = new Google_Service_DisplayVideo_FrequencyCap();
$frequencyCap->setMaxImpressions(10);
$frequencyCap->setTimeUnit('TIME_UNIT_DAYS');
$frequencyCap->setTimeUnitCount(1);
$campaign->setFrequencyCap($frequencyCap);

// Call the API, creating the campaign under the given advertiser.
$result = $this->service->advertisers_campaigns->create(
    advertiser-id,
    $campaign
);

// Display the new campaign.
printf('Campaign %s was created.\n', $result['name']);

একটি সন্নিবেশ আদেশ তৈরি করুন

এখানে একটি সন্নিবেশ আদেশ কিভাবে তৈরি করতে হয় তার একটি উদাহরণ:

জাভা

// Create an insertion order object.
InsertionOrder insertionOrder = new InsertionOrder();
insertionOrder.setCampaignId(campaign-id);
insertionOrder.setDisplayName(display-name);
insertionOrder.setEntityStatus("ENTITY_STATUS_DRAFT");

// Create and add the pacing setting.
Pacing pacing = new Pacing();
pacing.setPacingPeriod("PACING_PERIOD_DAILY");
pacing.setPacingType("PACING_TYPE_EVEN");
pacing.setDailyMaxMicros(10000L);
insertionOrder.setPacing(pacing);

// Create and set the frequency cap.
FrequencyCap frequencyCap = new FrequencyCap();
frequencyCap.setTimeUnit("TIME_UNIT_DAYS");
frequencyCap.setTimeUnitCount(1);
frequencyCap.setMaxImpressions(10);
insertionOrder.setFrequencyCap(frequencyCap);

// Create and set the key performance indicator (KPI).
Kpi kpi = new Kpi();
kpi.setKpiType("KPI_TYPE_CPC");
kpi.setKpiAmountMicros(1000000L);
insertionOrder.setKpi(kpi);

// Create a budget object.
InsertionOrderBudget insertionOrderBudget = new InsertionOrderBudget();
insertionOrderBudget.setBudgetUnit("BUDGET_UNIT_CURRENCY");

// Create a budget segment object.
InsertionOrderBudgetSegment insertionOrderBudgetSegment =
   new InsertionOrderBudgetSegment();
insertionOrderBudgetSegment.setBudgetAmountMicros(100000L);

// Create the date range for the budget segment.
DateRange dateRange = new DateRange();

// Set the start date to one week from now and the end date to two weeks
// from now.
Calendar calendarStartDate = Calendar.getInstance().add(Calendar.DATE, 7);
Calendar calendarEndDate = Calendar.getInstance().add(Calendar.DATE, 14);
dateRange.setStartDate(
   new Date()
      .setYear(calendarStartDate.get(Calendar.YEAR))
      .setMonth(calendarStartDate.get(Calendar.MONTH))
      .setDay(calendarStartDate.get(Calendar.DAY_OF_MONTH)));
dateRange.setEndDate(
   new Date()
      .setYear(calendarEndDate.get(Calendar.YEAR))
      .setMonth(calendarEndDate.get(Calendar.MONTH))
      .setDay(calendarEndDate.get(Calendar.DAY_OF_MONTH)));

// Add the date range to the budget segment.
insertionOrderBudgetSegment.setDateRange(dateRange);

// Add budget segment list to the budget.
insertionOrderBudget
   .setBudgetSegments(ImmutableList.of(insertionOrderBudgetSegment));

// Set budget.
insertionOrder.setBudget(insertionOrderBudget);

// Configure the create request.
InsertionOrders.Create request =
   service.advertisers().insertionOrders()
       .create(advertiser-id, insertionOrder);

// Create the insertion order.
InsertionOrder response = request.execute();

// Display the new insertion order.
System.out.printf("InsertionOrder %s was created.", response.getName());

পাইথন

# Create a future budget segment start and end dates.
startDate = date.today() + timedelta(days=7)
endDate = date.today() + timedelta(days=14)

# Create an insertion order object.
insertion_order_obj = {
    'campaignId' : campaign-id,
    'displayName': display-name,
    'entityStatus': 'ENTITY_STATUS_DRAFT',
    'pacing': {
        'pacingPeriod': 'PACING_PERIOD_DAILY',
        'pacingType': 'PACING_TYPE_EVEN',
        'dailyMaxMicros': 10000
    },
    'frequencyCap': {
        'maxImpressions': 10,
        'timeUnit': 'TIME_UNIT_DAYS',
        'timeUnitCount': 1
    },
    'kpi' : {
        'kpiType': 'KPI_TYPE_CPC',
        'kpiAmountMicros': 1000000
    },
    'budget': {
        'budgetUnit': 'BUDGET_UNIT_CURRENCY',
        'budgetSegments': [
            {
                'budgetAmountMicros': 100000,
                'dateRange': {
                    'startDate': {
                        'year': startDate.year,
                        'month': startDate.month,
                        'day': startDate.day
                    },
                    'endDate': {
                        'year': endDate.year,
                        'month': endDate.month,
                        'day': endDate.day
                    }
                }
            }
        ]
    }
}

# Create the insertion order.
insertionOrder = service.advertisers().insertionOrders().create(
    advertiserId=advertiser-id,
    body=insertion_order_obj
).execute()

# Display the new insertion order.
print("Insertion Order %s was created." % insertionOrder["name"])

পিএইচপি

// Create an insertion order object.
$insertionOrder = new Google_Service_DisplayVideo_InsertionOrder();
$insertionOrder->setCampaignId(campaign-id);
$insertionOrder->setDisplayName(display-name);
$insertionOrder->setEntityStatus('ENTITY_STATUS_DRAFT');

// Create and add the pacing setting.
$pacing = new Google_Service_DisplayVideo_Pacing();
$pacing->setPacingPeriod('PACING_PERIOD_DAILY');
$pacing->setPacingType('PACING_TYPE_EVEN');
$pacing->setDailyMaxMicros(10000);
$insertionOrder->setPacing($pacing);

// Create and set the frequency cap.
$frequencyCap = new Google_Service_DisplayVideo_FrequencyCap();
$frequencyCap->setMaxImpressions(10);
$frequencyCap->setTimeUnit('TIME_UNIT_DAYS');
$frequencyCap->setTimeUnitCount(1);
$insertionOrder->setFrequencyCap($frequencyCap);

// Create and set the key performance indicator (KPI).
$kpi = new Google_Service_DisplayVideo_Kpi();
$kpi->setKpiType('KPI_TYPE_CPC');
$kpi->setKpiAmountMicros(1000000);
$insertionOrder->setKpi($kpi);

// Create a budget object.
$budget = new Google_Service_DisplayVideo_InsertionOrderBudget();
$budget->setBudgetUnit('BUDGET_UNIT_CURRENCY');

// Create a budget segment object.
$budgetSegment =
    new Google_Service_DisplayVideo_InsertionOrderBudgetSegment();
$budgetSegment->setBudgetAmountMicros(100000);

// Create a date range object for the budget segment.
$dateRange = new Google_Service_DisplayVideo_DateRange();

// Create and assign a start date one week from now.
$startDateTime = new DateTime('today + 7 days');
$startDate = new Google_Service_DisplayVideo_Date();
$startDate->setYear($startDateTime->format('Y'));
$startDate->setMonth($startDateTime->format('n'));
$startDate->setDay($startDateTime->format('j'));
$dateRange->setStartDate($startDate);

// Create and assign an end date two weeks from now.
$endDateTime = new DateTime('today + 14 days');
$endDate = new Google_Service_DisplayVideo_Date();
$endDate->setYear($endDateTime->format('Y'));
$endDate->setMonth($endDateTime->format('n'));
$endDate->setDay($endDateTime->format('j'));
$dateRange->setendDate($endDate);

// Assign date range to budget segment.
$budgetSegment->setDateRange($dateRange);

// Set budget segment.
$budget->setBudgetSegments(array($budgetSegment));

// Set budget object.
$insertionOrder->setBudget($budget);

// Call the API, creating the insertion order under the advertiser and
// campaign given.
$result = $this->service->advertisers_insertionOrders->create(
    advertiser-id,
    $insertionOrder
);

printf('Insertion Order %s was created.\n', $result['name']);

একটি লাইন আইটেম তৈরি করুন

এখানে একটি লাইন আইটেম কিভাবে তৈরি করতে হয় তার একটি উদাহরণ:

জাভা

// Create a line item object.
LineItem lineItem = new LineItem();
lineItem.setInsertionOrderId(insertion-order-id);
lineItem.setDisplayName(display-name);
lineItem.setLineItemType("LINE_ITEM_TYPE_DISPLAY_DEFAULT");
lineItem.setEntityStatus("ENTITY_STATUS_DRAFT");

// Create and set the line item flight.
LineItemFlight lineItemFlight = new LineItemFlight();
lineItemFlight
   .setFlightDateType("LINE_ITEM_FLIGHT_DATE_TYPE_INHERITED");
lineItem.setFlight(lineItemFlight);

// Create and set the line item budget.
LineItemBudget lineItemBudget = new LineItemBudget();
lineItemBudget
   .setBudgetAllocationType("LINE_ITEM_BUDGET_ALLOCATION_TYPE_FIXED");
lineItem.setBudget(lineItemBudget);

// Create and set the pacing setting.
Pacing pacing = new Pacing();
pacing.setPacingPeriod("PACING_PERIOD_DAILY");
pacing.setPacingType("PACING_TYPE_EVEN");
pacing.setDailyMaxMicros(10000L);
lineItem.setPacing(pacing);

// Create and set the frequency cap.
FrequencyCap frequencyCap = new FrequencyCap();
frequencyCap.setTimeUnit("TIME_UNIT_DAYS");
frequencyCap.setTimeUnitCount(1);
frequencyCap.setMaxImpressions(10);
lineItem.setFrequencyCap(frequencyCap);

// Create and set the partner revenue model.
PartnerRevenueModel partnerRevenueModel = new PartnerRevenueModel();
partnerRevenueModel
   .setMarkupType("PARTNER_REVENUE_MODEL_MARKUP_TYPE_CPM");
partnerRevenueModel.setMarkupAmount(10L);
lineItem.setPartnerRevenueModel(partnerRevenueModel);

// Set the list of IDs of the creatives associated with the line item.
lineItem.setCreativeIds(creative-ids);

// Create and set the bidding strategy.
BiddingStrategy biddingStrategy = new BiddingStrategy();
biddingStrategy
   .setFixedBid(new FixedBidStrategy().setBidAmountMicros(100000L));
lineItem.setBidStrategy(biddingStrategy);

// Configure the create request.
LineItems.Create request =
   service.advertisers().lineItems().create(advertiser-id, lineItem);

// Create the line item.
LineItem response = request.execute();

// Display the new line item.
System.out.printf("LineItem %s was created.", response.getName());

পাইথন

# Create an line item object.
line_item_obj = {
    'insertionOrderId' : insertion-order-id,
    'displayName': display-name,
    'lineItemType': 'LINE_ITEM_TYPE_DISPLAY_DEFAULT',
    'entityStatus': 'ENTITY_STATUS_DRAFT',
    'flight': {
        'flightDateType': 'LINE_ITEM_FLIGHT_DATE_TYPE_INHERITED'
    },
    'budget': {
        'budgetAllocationType': 'LINE_ITEM_BUDGET_ALLOCATION_TYPE_FIXED'
    },
    'pacing': {
        'pacingPeriod': 'PACING_PERIOD_DAILY',
        'pacingType': 'PACING_TYPE_EVEN',
        'dailyMaxMicros': 10000
    },
    'frequencyCap': {
        'timeUnit': 'TIME_UNIT_DAYS',
        'timeUnitCount': 1,
        'maxImpressions': 10
    },
    'partnerRevenueModel': {
        'markupType': 'PARTNER_REVENUE_MODEL_MARKUP_TYPE_CPM',
        'markupAmount': 10
    },
    'creativeIds': creative-ids,
    'bidStrategy': {
        'fixedBid': {
            'bidAmountMicros': 100000
        }
    }
}

# Create the line item.
lineItem = service.advertisers().lineItems().create(
    advertiserId=advertiser-id,
    body=line_item_obj
).execute()

# Display the new line item.
print("Line Item %s was created." % lineItem["name"])

পিএইচপি

// Create a line item object.
$lineItem = new Google_Service_DisplayVideo_LineItem();
$lineItem->setInsertionOrderId(insertion-order-id);
$lineItem->setDisplayName(display-name);
$lineItem->setLineItemType('LINE_ITEM_TYPE_DISPLAY_DEFAULT');
$lineItem->setEntityStatus('ENTITY_STATUS_DRAFT');

// Create and set the line item flight.
$flight = new Google_Service_DisplayVideo_LineItemFlight();
$flight->setFlightDateType('LINE_ITEM_FLIGHT_DATE_TYPE_INHERITED');
$lineItem->setFlight($flight);

// Create and set the line item budget.
$budget = new Google_Service_DisplayVideo_LineItemBudget();
$budget->setBudgetAllocationType(
    'LINE_ITEM_BUDGET_ALLOCATION_TYPE_FIXED'
);
$lineItem->setBudget($budget);

// Create and set the pacing setting.
$pacing = new Google_Service_DisplayVideo_Pacing();
$pacing->setPacingPeriod('PACING_PERIOD_DAILY');
$pacing->setPacingType('PACING_TYPE_EVEN');
$pacing->setDailyMaxMicros(10000);
$lineItem->setPacing($pacing);

// Create and set the frequency cap.
$frequencyCap = new Google_Service_DisplayVideo_FrequencyCap();
$frequencyCap->setMaxImpressions(10);
$frequencyCap->setTimeUnit('TIME_UNIT_DAYS');
$frequencyCap->setTimeUnitCount(1);
$lineItem->setFrequencyCap($frequencyCap);

// Create and set the partner revenue model.
$partnerRevenueModel =
    new Google_Service_DisplayVideo_PartnerRevenueModel();
$partnerRevenueModel->setMarkupType(
    'PARTNER_REVENUE_MODEL_MARKUP_TYPE_CPM'
);
$partnerRevenueModel->setMarkupAmount(10);
$lineItem->setPartnerRevenueModel($partnerRevenueModel);

// Set the list of IDs of the creatives associated with the line item.
lineItem >setCreativeIds(creative-ids);

// Create and set the bidding strategy.
$biddingStrategy =  new Google_Service_DisplayVideo_BiddingStrategy();
$fixedBidStrategy = new Google_Service_DisplayVideo_FixedBidStrategy();
$fixedBidStrategy->setBidAmountMicros(100000);
$biddingStrategy->setFixedBid($fixedBidStrategy);
$lineItem->setBidStrategy($biddingStrategy);

// Create the line item.
$result = $this->service->advertisers_lineItems->create(
    advertiser-id,
    $lineItem
);

printf('Line Item %s was created.\n', $result['name']);

ডিফল্ট লাইন আইটেম তৈরি করুন

লাইন আইটেমগুলি একটি প্রদত্ত LineItemType দ্বারা নির্ধারিত ডিফল্ট কনফিগারেশনের পাশাপাশি তাদের অভিভাবক সন্নিবেশের আদেশের বিদ্যমান কনফিগারেশনগুলির সাথে তৈরি করা যেতে পারে। স্ট্যান্ডার্ড API লাইন আইটেম তৈরির বিপরীতে, ডিফল্ট লাইন আইটেমগুলিকে প্রজন্মের উপর তাদের অভিভাবক সন্নিবেশ ক্রম হিসাবে একই টার্গেটিং বরাদ্দ করা হয়, যা UI তে ঘটে। সন্নিবেশ অর্ডার AssignedTargetingOptions পরিষেবা ব্যবহার করে এটি পরিচালনা করুন

কিভাবে একটি ডিফল্ট লাইন আইটেম তৈরি করতে হয় তার একটি উদাহরণ এখানে দেওয়া হল:

জাভা

// Create a default line item generation request.
GenerateDefaultLineItemRequest defaultLineItemRequest =
    new GenerateDefaultLineItemRequest();
defaultLineItemRequest.setInsertionOrderId(insertion-order-id);
defaultLineItemRequest.setDisplayName(display-name);
defaultLineItemRequest.setLineItemType("LINE_ITEM_TYPE_DISPLAY_DEFAULT");

// Configure the request.
LineItems.GenerateDefault request =
    service
        .advertisers()
        .lineItems()
        .generateDefault(advertiser-id, defaultLineItemRequest);

// Generate the default line item.
LineItem response = request.execute();

// Display the new line item.
System.out.printf("LineItem %s was created.", response.getName());

পাইথন

# Create a default line item generation request.
default_li_request = {
    'insertionOrderId' : insertion-order-id,
    'displayName': display-name,
    'lineItemType': 'LINE_ITEM_TYPE_DISPLAY_DEFAULT'
}

# Generate the default line item.
line_item = service.advertisers().lineItems().generateDefault(
    advertiserId=advertiser-id,
    body=default_li_request
).execute()

# Display the new line item.
print("Line Item %s was created." % lineItem["name"])

পিএইচপি

// Create a default line item generation request.
$defaultLineItemRequest =
    new Google_Service_DisplayVideo_GenerateDefaultLineItemRequest();
$defaultLineItemRequest->setInsertionOrderId(insertion-order-id);
$defaultLineItemRequest->setDisplayName(display-name);
$defaultLineItemRequest->setLineItemType('LINE_ITEM_TYPE_DISPLAY_DEFAULT');

// Generate the default line item.
$result = $this->service->advertisers_lineItems->generateDefault(
    advertiser-id,
    $defaultLineItemRequest
);

// Display the new line item.
printf('Line Item %s was created.\n', $result['name']);

ডুপ্লিকেট লাইন আইটেম

বিদ্যমান লাইন আইটেমগুলি সদৃশ হতে পারে, যার ফলে একই কনফিগারেশন এবং লক্ষ্য নির্ধারণের সেটিংস সহ একটি নতুন লাইন আইটেম একই সন্নিবেশ ক্রম অনুসারে তৈরি করা হয়েছে।

একটি বিদ্যমান লাইন আইটেম কিভাবে নকল করা যায় তার একটি উদাহরণ এখানে দেওয়া হল:

জাভা

// Create the duplicate line item request body.
DuplicateLineItemRequest requestBody = new DuplicateLineItemRequest();
requestBody.setTargetDisplayName(target-display-name);

// Configure the request.
LineItems.Duplicate request = service.advertisers().lineItems()
    .duplicate(advertiser-id, line-item-id, requestBody);

// Duplicate the line item.
DuplicateLineItemResponse response = request.execute();

// Display the line item ID of the new duplicate line item.
System.out.printf("A duplicate line item with the ID %s was created.",
    response.getDuplicateLineItemId());

পাইথন

# Create the duplicate line item request body.
duplicate_request = {
    'targetDisplayName': target-display-name
}

# Duplicate the line item.
response = service.advertisers().lineItems().duplicate(
    advertiserId=advertiser-id,
    lineItemId=line-item-id,
    body=duplicate_request
).execute()

# Display the line item ID of the new duplicate line item.
print("A duplicate line item with the ID %s was created."
      % response["duplicateLineItemId"])

পিএইচপি

// Create the duplicate line item request body.
$requestBody = new Google_Service_DisplayVideo_DuplicateLineItemRequest();
$requestBody->setTargetDisplayName(target-display-name);

// Call the API, duplicating the line item.
$response = $service
    ->advertisers_lineItems
    ->duplicate(
        advertiser-id,
        line-item-id,
        $requestBody
    );

// Display the line item ID of the new duplicate line item.
printf(
    'A duplicate line item with the ID %s was created.',
    $response->getDuplicateLineItemId()
);