Skip to content

Commit

Permalink
Changes for release v13_1. (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
fiboknacky authored Apr 27, 2023
1 parent af5bbaf commit 460dccf
Show file tree
Hide file tree
Showing 326 changed files with 4,905 additions and 257 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 19.1.0
* Added support for v13_1 of Google Ads API.
* Renamed the HotelAds example directory to Travel.
* Added AddThingsToDoAd example.
* Updated AddPerformanceMaxForTravelGoalsCampaign example.

## 19.0.0
* Removed support for v11 of Google Ads API.
* Updated CreateExperiment example.
Expand Down
2 changes: 1 addition & 1 deletion examples/AdvancedOperations/AddCallAd.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static function main()
* @param int $customerId the customer ID
* @param int $adGroupId the ad group ID to add a call ad to
* @param string $phoneCountry the phone country (2-letter code)
* @param string $phoneNumber the raw phone number, e.g. '(123) 456-7890'
* @param string $phoneNumber the raw phone number, e.g. '(800) 555-0100'
* @param int|null $conversionActionId the conversion action ID to attribute conversions to
*/
public static function runExample(
Expand Down
2 changes: 1 addition & 1 deletion examples/AdvancedOperations/AddSmartCampaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class AddSmartCampaign
// https://developers.google.com/google-ads/api/reference/data/codes-formats#expandable-7
private const LANGUAGE_CODE = 'en';
private const LANDING_PAGE_URL = 'http://www.example.com';
private const PHONE_NUMBER = '555-555-5555';
private const PHONE_NUMBER = '800-555-0100';
private const BUDGET_TEMPORARY_ID = '-1';
private const SMART_CAMPAIGN_TEMPORARY_ID = '-2';
private const AD_GROUP_TEMPORARY_ID = '-3';
Expand Down
4 changes: 2 additions & 2 deletions examples/Extensions/AddCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static function main()
* @param GoogleAdsClient $googleAdsClient the Google Ads API client
* @param int $customerId the client customer ID
* @param string $phoneCountry the phone country (2-letter code)
* @param string $phoneNumber the raw phone number, e.g. '(123) 456-7890'
* @param string $phoneNumber the raw phone number, e.g. '(800) 555-0100'
* @param int|null $conversionActionId the conversion action ID to attribute conversions to
*/
public static function runExample(
Expand Down Expand Up @@ -146,7 +146,7 @@ public static function runExample(
* @param GoogleAdsClient $googleAdsClient the Google Ads API client
* @param int $customerId the client customer ID
* @param string $phoneCountry the phone country (2-letter code)
* @param string $phoneNumber the raw phone number, e.g. '(123) 456-7890'
* @param string $phoneNumber the raw phone number, e.g. '(800) 555-0100'
* @param int|null $conversionActionId the conversion action ID to attribute conversions to
* @return string the resource name of the created call asset
*/
Expand Down
16 changes: 8 additions & 8 deletions examples/Remarketing/AddCustomerMatchUserList.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,30 +344,30 @@ private static function buildOfflineUserDataJobOperations(): array
// The first user data has an email address and a phone number.
$rawRecord1 = [
// The first user data has an email address and a phone number.
'email' => 'test@gmail.com',
'email' => 'dana@example.com',
// Phone number to be converted to E.164 format, with a leading '+' as required. This
// includes whitespace that will be removed later.
'phone' => '+1 234 5678910'
'phone' => '+1 800 5550101'
];
$rawRecords[] = $rawRecord1;

// The second user data has an email address, a mailing address, and a phone number.
$rawRecord2 = [
// Email address that includes a period (.) before the Gmail domain.
'email' => 'test.2@gmail.com',
'email' => 'alex.2@example.com',
// Address that includes all four required elements: first name, last name, country
// code, and postal code.
'firstName' => 'John',
'lastName' => 'Doe',
'firstName' => 'Alex',
'lastName' => 'Quinn',
'countryCode' => 'US',
'postalCode' => '10011',
'postalCode' => '94045',
// Phone number to be converted to E.164 format, with a leading '+' as required.
'phone' => '+1 234 5678911',
'phone' => '+1 800 5550102',
];
$rawRecords[] = $rawRecord2;

// The third user data only has an email address.
$rawRecord3 = ['email' => 'test3@gmail.com'];
$rawRecord3 = ['email' => 'charlie@example.com'];
$rawRecords[] = $rawRecord3;

// Iterates over the raw input list and creates a UserData object for each record.
Expand Down
2 changes: 1 addition & 1 deletion examples/Remarketing/UploadCallConversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static function main()
* @param int $customerId the customer ID
* @param int $conversionActionId the ID of the conversion action to upload to
* @param string $callerId the caller ID from which this call was placed. Caller ID is expected
* to be in E.164 format with preceding '+' sign. e.g. "+16502531234"
* to be in E.164 format with preceding '+' sign. e.g. "+18005550100"
* @param string $callStartDateTime the date and time at which the call occurred. The format is
* "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. “2019-01-01 12:32:45-08:00”
* @param string $conversionDateTime the date and time of the conversion (should be after the
Expand Down
38 changes: 6 additions & 32 deletions examples/Remarketing/UploadConversionEnhancement.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Google\Ads\GoogleAds\V13\Services\ConversionAdjustment;
use Google\Ads\GoogleAds\V13\Services\ConversionAdjustmentResult;
use Google\Ads\GoogleAds\V13\Services\GclidDateTimePair;
use Google\Ads\GoogleAds\V13\Services\RestatementValue;
use Google\ApiCore\ApiException;

/**
Expand All @@ -57,9 +56,6 @@ class UploadConversionEnhancement
// Setting this field is optional, but recommended.
private const CONVERSION_DATE_TIME = null;
private const USER_AGENT = null;
private const RESTATEMENT_VALUE = null;
// The currency of the restatement value.
private const CURRENCY_CODE = null;

public static function main()
{
Expand All @@ -70,9 +66,7 @@ public static function main()
ArgumentNames::CONVERSION_ACTION_ID => GetOpt::REQUIRED_ARGUMENT,
ArgumentNames::ORDER_ID => GetOpt::REQUIRED_ARGUMENT,
ArgumentNames::CONVERSION_DATE_TIME => GetOpt::OPTIONAL_ARGUMENT,
ArgumentNames::USER_AGENT => GetOpt::OPTIONAL_ARGUMENT,
ArgumentNames::RESTATEMENT_VALUE => GetOpt::OPTIONAL_ARGUMENT,
ArgumentNames::CURRENCY_CODE => GetOpt::OPTIONAL_ARGUMENT
ArgumentNames::USER_AGENT => GetOpt::OPTIONAL_ARGUMENT
]);

// Generate a refreshable OAuth2 credential for authentication.
Expand All @@ -92,9 +86,7 @@ public static function main()
$options[ArgumentNames::CONVERSION_ACTION_ID] ?: self::CONVERSION_ACTION_ID,
$options[ArgumentNames::ORDER_ID] ?: self::ORDER_ID,
$options[ArgumentNames::CONVERSION_DATE_TIME] ?: self::CONVERSION_DATE_TIME,
$options[ArgumentNames::USER_AGENT] ?: self::USER_AGENT,
$options[ArgumentNames::RESTATEMENT_VALUE] ?: self::RESTATEMENT_VALUE,
$options[ArgumentNames::CURRENCY_CODE] ?: self::CURRENCY_CODE
$options[ArgumentNames::USER_AGENT] ?: self::USER_AGENT
);
} catch (GoogleAdsException $googleAdsException) {
printf(
Expand Down Expand Up @@ -134,8 +126,6 @@ public static function main()
* @param string|null $conversionDateTime the date and time of the conversion.
* The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", e.g. “2019-01-01 12:32:45-08:00”
* @param string|null $userAgent the HTTP user agent of the conversion
* @param float|null $restatementValue the enhancement value
* @param string|null $restatementCurrencyCode the currency of the enhancement value
*/
// [START upload_conversion_enhancement]
public static function runExample(
Expand All @@ -144,9 +134,7 @@ public static function runExample(
int $conversionActionId,
string $orderId,
?string $conversionDateTime,
?string $userAgent,
?float $restatementValue,
?string $restatementCurrencyCode
?string $userAgent
) {
// [START create_adjustment]
// Creates the conversion enhancement.
Expand All @@ -167,8 +155,8 @@ public static function runExample(
// Creates a user identifier using sample values for the user address.
$addressIdentifier = new UserIdentifier([
'address_info' => new OfflineUserAddressInfo([
'hashed_first_name' => self::normalizeAndHash($hashAlgorithm, 'Joanna'),
'hashed_last_name' => self::normalizeAndHash($hashAlgorithm, 'Smith'),
'hashed_first_name' => self::normalizeAndHash($hashAlgorithm, 'Dana'),
'hashed_last_name' => self::normalizeAndHash($hashAlgorithm, 'Quinn'),
'hashed_street_address' => self::normalizeAndHash(
$hashAlgorithm,
'1600 Amphitheatre Pkwy'
Expand All @@ -187,7 +175,7 @@ public static function runExample(
// Uses the normalize and hash method specifically for email addresses.
'hashed_email' => self::normalizeAndHashEmailAddress(
$hashAlgorithm,
'joannasmith@example.com'
'dana@example.com'
),
// Optional: Specifies the user identifier source.
'user_identifier_source' => UserIdentifierSource::FIRST_PARTY
Expand All @@ -212,20 +200,6 @@ public static function runExample(
// as same-device or both attributed as cross-device.
$conversionAdjustment->setUserAgent($userAgent);
}

if ($restatementValue !== null) {
// Sets the new value of the conversion.
$restatementValue = new RestatementValue([
'adjusted_value' => $restatementValue
]);
// Sets the currency of the new value, if provided. Otherwise, the default currency
// from the conversion action is used, and if that is not set then the account currency
// is used.
if ($restatementCurrencyCode !== null) {
$restatementValue->setCurrencyCode($restatementCurrencyCode);
}
$conversionAdjustment->setRestatementValue($restatementValue);
}
// [END create_adjustment]

// Issues a request to upload the conversion enhancement.
Expand Down
6 changes: 3 additions & 3 deletions examples/Remarketing/UploadStoreSalesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ private static function buildOfflineUserDataJobOperations(
'user_identifiers' => [
new UserIdentifier([
// Email addresses must be normalized and hashed.
'hashed_email' => self::normalizeAndHash('customer@example.com')
'hashed_email' => self::normalizeAndHash('dana@example.com')
]),
new UserIdentifier([
'address_info' => new OfflineUserAddressInfo(['state' => 'NY'])
Expand Down Expand Up @@ -552,8 +552,8 @@ private static function buildOfflineUserDataJobOperations(
new UserIdentifier([
'address_info' => new OfflineUserAddressInfo([
// First and last name must be normalized and hashed.
'hashed_first_name' => self::normalizeAndHash('John'),
'hashed_last_name' => self::normalizeAndHash('Doe'),
'hashed_first_name' => self::normalizeAndHash('Dana'),
'hashed_last_name' => self::normalizeAndHash('Quinn'),
// Country code and zip code are sent in plain text.
'country_code' => 'US',
'postal_code' => '10011'
Expand Down
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/AssetSetTypes.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/AssetTypes.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/Extensions.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/FrequencyCap.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/Metrics.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/Segments.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Common/TagSnippet.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Enums/RecommendationType.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/AssetError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/AssetGroupError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/AssetLinkError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/CampaignError.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/Errors.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/RecommendationError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/RequestError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Errors/UserListError.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/Ad.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/AdGroupAd.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/AdGroupCriterion.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/Asset.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/AssetSet.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/Campaign.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/ChangeEvent.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/ConversionAction.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/FeedItem.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/FeedMapping.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/Recommendation.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Resources/SharedSet.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AdGroupAdService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AdGroupService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AdService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AssetGroupService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AssetService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AssetSetService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/AudienceService.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/BatchJobService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/CampaignService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/ExperimentService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/FeedItemService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/FeedService.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/GoogleAdsService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/LabelService.php
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/MediaFileService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/ReachPlanService.php
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/SharedSetService.php
Binary file not shown.
Binary file not shown.
Binary file modified metadata/Google/Ads/GoogleAds/V13/Services/UserListService.php
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Google/Ads/GoogleAds/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ class Constants
public const LIBRARY_NAME = 'gccl';

// The library version.
public const LIBRARY_VERSION = '19.0.0';
public const LIBRARY_VERSION = '19.1.0';
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
use Google\Ads\GoogleAds\V13\Services\CustomerManagerLinkServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomerNegativeCriterionServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomerServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomerSkAdNetworkConversionValueSchemaServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomerUserAccessInvitationServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomerUserAccessServiceClient;
use Google\Ads\GoogleAds\V13\Services\CustomInterestServiceClient;
Expand Down Expand Up @@ -751,6 +752,14 @@ public function getCustomerServiceClient(): CustomerServiceClient
return new CustomerServiceClient($this->getGoogleAdsClientOptions());
}

/**
* @return CustomerSkAdNetworkConversionValueSchemaServiceClient
*/
public function getCustomerSkAdNetworkConversionValueSchemaServiceClient(): CustomerSkAdNetworkConversionValueSchemaServiceClient
{
return new CustomerSkAdNetworkConversionValueSchemaServiceClient($this->getGoogleAdsClientOptions());
}

/**
* @return CustomerUserAccessInvitationServiceClient
*/
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 460dccf

Please sign in to comment.