<?php include 'header.php'; $add = $_GET['add']; $name = $_GET['name']; $amount = $_GET['amount']; if ($add = "1") { AddCampaigns($user, $name, $amount); } ?>
$customParameter1->Key = "promoCode"; $customParameter1->Value = "PROMO" . ($i + 1); $textAd->UrlCustomParameters->Parameters[] = $customParameter1; $customParameter2 = new CustomParameter(); $customParameter2->Key = "season"; $customParameter2->Value = "summer"; $textAd->UrlCustomParameters->Parameters[] = $customParameter2; $ads[] = new SoapVar($textAd, SOAP_ENC_OBJECT, 'TextAd', $proxy->GetNamespace()); } $ads[0]->enc_value->Title = "Women's Shoe Sale"; $ads[1]->enc_value->Title = "Women's Super Shoe Sale"; $ads[2]->enc_value->Title = "Women's Red Shoe Sale"; $ads[3]->enc_value->Title = ""; $ads[4]->enc_value->Title = "Women's Super Shoe Sale"; // Add the campaign, ad group, keywords, and ads $campaignIds = AddCampaigns($proxy, $AccountId, $campaigns); $adGroupIds = AddAdGroups($proxy, $campaignIds[0], $adGroups); $addKeywordsResponse = AddKeywords($proxy, $adGroupIds[0], $keywords); $keywordIds = $addKeywordsResponse->KeywordIds->long; $keywordErrors = $addKeywordsResponse->PartialErrors->BatchError; $addAdsResponse = AddAds($proxy, $adGroupIds[0], $ads); $adIds = $addAdsResponse->AdIds->long; $adErrors = $addAdsResponse->PartialErrors->BatchError; // Print the new assigned campaign and ad group identifiers PrintCampaignIdentifiers($campaignIds); PrintAdGroupIdentifiers($adGroupIds); // Print the new assigned keyword and ad identifiers, as well as any partial errors PrintKeywordResults($keywords, $keywordIds, $keywordErrors); PrintAdResults($ads, $adIds, $adErrors); // Delete the campaign, ad group, keyword, and ad that were previously added. // You should remove this line if you want to view the added entities in the
<div class="addcamp"></div> <?php if (@$_POST['submit']) { $user = new AdWordsUser(); $name = $_POST['name']; $channel = $_POST['advertisingChannelType']; $typeinfo = $_POST['typeinfo']; $budget = $_POST['budget'] * 1000000; $startdate = $_POST['startdate']; $sdate = explode('/', $startdate); $stdate = $sdate[2] . $sdate[0] . $sdate[1]; $enddate = $_POST['enddate']; $edate = explode('/', $enddate); $etdate = $edate[2] . $edate[0] . $edate[1]; echo $name; AddCampaigns($user, $name, $channel, $typeinfo, $budget, $stdate, $etdate); } ?> <!-- Dashboard Area Start --> <div class="col-md-12 dashboard_sec"> <div class="panel panel-primary"> <div class="panel-heading col-md-2"> <h3>All campaigns</h3> <ul class="nav panel-tabs"> <?php $all_campaign = GetCampaigns($user, $adwords_version); foreach ($all_campaign as $row) { ?> <li class="main-tab" value="<?php echo $row['id'];
// Make the mutate request. $result = $campaignService->mutate($operations); // Display results. foreach ($result->value as $campaign) { echo "Campaign with name '%s' and ID '%s' was added.\n", $campaign->name, $campaign->id; } } if (@$_POST['submit']) { $name = $_POST['name']; $channel = $_POST['channel']; try { // Get AdWordsUser from credentials in "../auth.ini" // relative to the AdWordsUser.php file's directory. $user = new AdWordsUser(); // Log every SOAP XML request and response. $user->LogAll(); // Run the example. AddCampaigns($user, $name, $channel); } catch (Exception $e) { echo "An error has occurred: %s\n", $e->getMessage(); } } ?> <form action="" method="post" > <label>Name</label> <input type="text" name="name" value=""><br> <label>Advertising Channel Type</label> <input type="text" name="channel" value=""><br> <input type="submit" name="submit" value="submit"><br> </form>
$AccountId = "<AccountIdGoesHere>"; $PartitionActions = array(); // AdGroupCriterionAction array $ReferenceId = -1; // Campaign Management WSDL $wsdl = "https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/V10/CampaignManagementService.svc?singleWsdl"; $ids = null; try { $proxy = ClientProxy::ConstructWithAccountAndCustomerId($wsdl, $UserName, $Password, $DeveloperToken, $AccountId, $CustomerId, null); $stores = GetStores($proxy); if (!isset($stores)) { printf("Customer %d does not have any regeistered BMC stores.\n\n", $CustomerId); return; } // Create a Bing Shopping campaign using the ID of the first store in the list. $campaignIds = AddCampaigns($proxy, $AccountId, $stores[0]->Id); PrintCampaignIdentifiers($campaignIds->long); $adGroupIds = AddAdGroups($proxy, $campaignIds->long[0]); PrintAdGroupIdentifiers($adGroupIds->long); $response = AddAds($proxy, $adGroupIds->long[0]); PrintAdIdentifiers($response->AdIds->long, $response->PartialErrors); // Add criterion to the campaign. The criterion is used to limit the campaign to a subset of // your product catalog. $addCriterionResponse = AddCampaignCriterion($proxy, $campaignIds->long[0]); PrintCampaignCriterionIdentifiers($addCriterionResponse->CampaignCriterionIds->long, $addCriterionResponse->NestedPartialErrors); AddAndUpdateAdGroupCriterion($proxy, $AccountId, $PartitionActions, $adGroupIds->long[0]); $applyPartitionActionsResponse = AddBranchAndLeafCriterion($proxy, $AccountId, $PartitionActions, $adGroupIds->long[0]); $rootId = $applyPartitionActionsResponse->AdGroupCriterionIds->long[1]; $electronicsCriterionId = $applyPartitionActionsResponse->AdGroupCriterionIds->long[8]; UpdateBranchAndLeafCriterion($proxy, $PartitionActions, $AccountId, $adGroupIds->long[0], $rootId, $electronicsCriterionId); // Delete the campaign from the account.