/**
 * Runs the example.
 *
 * @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 string $feedName the name of the new AdCustomizerFeed
 */
function AddAdCustomizerExample(AdWordsUser $user, $adGroupIds, $feedName)
{
    // Create a customizer feed. One feed per account can be used for all ads.
    $adCustomizerFeed = CreateCustomizerFeed($user, $feedName);
    // Add feed items containing the values we'd like to place in ads.
    CreateCustomizerFeedItems($user, $adGroupIds, $adCustomizerFeed);
    // All set! We can now create ads with customizations.
    CreateAdsWithCustomizations($user, $adGroupIds, $feedName);
}
/**
 * Runs the example.
 *
 * @param AdWordsUser $user the user to run the example with
 * @param array $adGroupIds the IDs of the ad groups to target with the FeedItem
 */
function AddAdCustomizerExample(AdWordsUser $user, $adGroupIds)
{
    // Create a customizer feed. One feed per account can be used for all ads.
    $dataHolder = CreateCustomizerFeed($user);
    // Create a feed mapping to map the fields with customizer IDs.
    CreateFeedMapping($user, $dataHolder);
    // Add feed items containing the values we'd like to place in ads.
    CreateCustomizerFeedItems($user, $adGroupIds, $dataHolder);
    // Create a customer (account-level) feed with a matching function that
    // determines when to use this feed. For this case we use the "IDENTITY"
    // matching function that is always true just to associate this feed with the
    // customer. The targeting is done within the feed items using the
    // campaignTargeting, adGroupTargeting, or keywordTargeting attributes.
    CreateCustomerFeed($user, $dataHolder);
    // All set! We can now create ads with customizations.
    CreateAdsWithCustomizations($user, $adGroupIds);
}