/**
 * Creates FeedItems with the values to use in ad customizations for each ad
 * group in adGroupIds
 *
 * @param AdWordsUser $user the user to run the example with
 * @param array $adGroupIds the IDs of the ad groups to target with the FeedItem
 * @param AdCustomizerFeed $adCustomizerFeed the customizer feed
 */
function CreateCustomizerFeedItems(AdWordsUser $user, $adGroupIds, $adCustomizerFeed)
{
    // Get the FeedItemService, which loads the required classes.
    $feedItemService = $user->GetService('FeedItemService', ADWORDS_VERSION);
    $operations = array();
    $marsDate = mktime(0, 0, 0, date('m'), 1, date('Y'));
    $venusDate = mktime(0, 0, 0, date('m'), 15, date('Y'));
    // Create operations to add FeedItems.
    $operations[] = CreateFeedItemAddOperation('Mars', '$1234.56', date('Ymd His', $marsDate), $adGroupIds[0], $adCustomizerFeed);
    $operations[] = CreateFeedItemAddOperation('Venus', '$1450.00', date('Ymd His', $venusDate), $adGroupIds[1], $adCustomizerFeed);
    $result = $feedItemService->mutate($operations);
    foreach ($result->value as $feedItem) {
        printf("FeedItem with feedItemId %d was added.\n", $feedItem->feedItemId);
    }
    return $adCustomizerFeed;
}
/**
 * Creates FeedItems with the values to use in ad customizations for each ad
 * group in adGroupIds
 *
 * @param AdWordsUser $user the user to run the example with
 * @param array $adGroupIds the IDs of the ad groups to target with the FeedItem
 * @param array $dataHolder IDs associated to created customizer feed metadata
 */
function CreateCustomizerFeedItems(AdWordsUser $user, $adGroupIds, $dataHolder)
{
    // Get the FeedItemService, which loads the required classes.
    $feedItemService = $user->GetService('FeedItemService', ADWORDS_VERSION);
    $operations = array();
    // Create operations to add FeedItems.
    $operations[] = CreateFeedItemAddOperation('Mars', '$1234.56', '20140601 000000', $adGroupIds[0], $dataHolder);
    $operations[] = CreateFeedItemAddOperation('Venus', '$1450.00', '20140615 120000', $adGroupIds[1], $dataHolder);
    $result = $feedItemService->mutate($operations);
    foreach ($result->value as $feedItem) {
        printf("FeedItem with feedItemId %d was added.\n", $feedItem->feedItemId);
    }
    return $dataHolder;
}