Skip to content

Commit 7a002e5

Browse files
authored
Changes for intermediate release v8_0. (#455)
1 parent 0f999cf commit 7a002e5

4,047 files changed

Lines changed: 89 additions & 1706312 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
14.0.0 - 2021-07-07
2+
-------------------
3+
- Added and updated examples for Google Ads API v8.0.
4+
- Removed support for Google Ads API v5.0.
5+
- Moved generateThirdPartyDirectory execution out of configure phase (#444).
6+
- Added sonatype publish for shadow jar (#445).
7+
- Add required artifacts for central repo (#446).
8+
19
13.0.0 - 2021-06-17
210
-------------------
311
- Added support and examples for Google Ads API v8.0.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ This project hosts the Java client library for the Google Ads API.
2323
<dependency>
2424
<groupId>com.google.api-ads</groupId>
2525
<artifactId>google-ads</artifactId>
26-
<version>13.0.0</version>
26+
<version>14.0.0</version>
2727
</dependency>
2828

2929
## Gradle dependency
3030

31-
implementation 'com.google.api-ads:google-ads:13.0.0'
31+
implementation 'com.google.api-ads:google-ads:14.0.0'
3232

3333
## Documentation
3434

google-ads-examples/src/main/java/com/google/ads/googleads/examples/advancedoperations/GetAdGroupBidModifiers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ private void runExample(
115115
+ " ad_group_bid_modifier.hotel_check_in_day.day_of_week,"
116116
+ " ad_group_bid_modifier.preferred_content.type "
117117
+ "FROM"
118-
+ " ad_group_bid_modifier";
118+
+ " ad_group_bid_modifier"
119+
+ "LIMIT 10000";
119120
if (adGroupId != null) {
120121
searchQuery += String.format(" WHERE ad_group.id = %d", adGroupId);
121122
}

google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadCallConversion.java

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
import com.google.ads.googleads.v8.services.CallConversion;
2424
import com.google.ads.googleads.v8.services.CallConversionResult;
2525
import com.google.ads.googleads.v8.services.ConversionUploadServiceClient;
26+
import com.google.ads.googleads.v8.services.CustomVariable;
2627
import com.google.ads.googleads.v8.services.UploadCallConversionsRequest;
2728
import com.google.ads.googleads.v8.services.UploadCallConversionsResponse;
29+
import com.google.ads.googleads.v8.utils.ResourceNames;
2830
import java.io.FileNotFoundException;
2931
import java.io.IOException;
3032

@@ -59,6 +61,14 @@ private static class UploadCallConversionParams extends CodeSampleParams {
5961

6062
@Parameter(names = ArgumentNames.CONVERSION_VALUE)
6163
private double conversionValue;
64+
65+
// Optional: Specify the conversion custom variable ID and value you want to
66+
// associate with the call conversion upload.
67+
@Parameter(names = ArgumentNames.CONVERSION_CUSTOM_VARIABLE_ID)
68+
private Long conversionCustomVariableId;
69+
70+
@Parameter(names = ArgumentNames.CONVERSION_CUSTOM_VARIABLE_VALUE)
71+
private String conversionCustomVariableValue;
6272
}
6373

6474
public static void main(String[] args) {
@@ -67,11 +77,15 @@ public static void main(String[] args) {
6777
// Either pass the required parameters for this example on the command line, or insert them
6878
// into the code here. See the parameter class definition above for descriptions.
6979
params.customerId = Long.parseLong("INSERT_CUSTOMER_ID");
70-
params.conversionActionId = "INSERT_CONVERSAION_ACTION_ID";
80+
params.conversionActionId = "INSERT_CONVERSION_ACTION_ID";
7181
params.callerId = "INSERT_CALLER_ID";
7282
params.callStartDateTime = "INSERT_CALL_START_DATE_TIME";
7383
params.conversionDateTime = "INSERT_CONVERSION_DATE_TIME";
7484
params.conversionValue = Double.parseDouble("INSERT_CONVERSION_VALUE");
85+
// Optionally specify the conversion custom variable ID and value you want to
86+
// associate with the call conversion upload.
87+
params.conversionCustomVariableId = null;
88+
params.conversionCustomVariableValue = null;
7589
}
7690

7791
GoogleAdsClient googleAdsClient = null;
@@ -94,7 +108,9 @@ public static void main(String[] args) {
94108
params.conversionActionId,
95109
params.callerId,
96110
params.callStartDateTime,
97-
params.conversionValue);
111+
params.conversionValue,
112+
params.conversionCustomVariableId,
113+
params.conversionCustomVariableValue);
98114
} catch (GoogleAdsException gae) {
99115
// GoogleAdsException is the base class for most exceptions thrown by an API request.
100116
// Instances of this exception have a message and a GoogleAdsFailure that contains a
@@ -120,6 +136,10 @@ public static void main(String[] args) {
120136
* @param callerId the caller ID.
121137
* @param callStartDateTime the call start date time
122138
* @param conversionValue the value of the conversion in USD.
139+
* @param conversionCustomVariableId the ID of the conversion custom variable to associate with
140+
* the upload.
141+
* @param conversionCustomVariableValue the value of the conversion custom variable to associate
142+
* with the upload.
123143
*/
124144
// [START upload_call_conversion]
125145
private void runExample(
@@ -128,16 +148,27 @@ private void runExample(
128148
String conversionActionId,
129149
String callerId,
130150
String callStartDateTime,
131-
double conversionValue) {
151+
double conversionValue,
152+
Long conversionCustomVariableId,
153+
String conversionCustomVariableValue) {
132154
// Create a call conversion by specifying currency as USD.
133-
CallConversion conversion =
155+
CallConversion.Builder conversionBuilder =
134156
CallConversion.newBuilder()
135157
.setConversionAction(conversionActionId)
136158
.setCallerId(callerId)
137159
.setCallStartDateTime(callStartDateTime)
138160
.setConversionValue(conversionValue)
139-
.setCurrencyCode("USD")
140-
.build();
161+
.setCurrencyCode("USD");
162+
163+
if (conversionCustomVariableId != null && conversionCustomVariableValue != null) {
164+
conversionBuilder.addCustomVariables(
165+
CustomVariable.newBuilder()
166+
.setConversionCustomVariable(
167+
ResourceNames.conversionCustomVariable(customerId, conversionCustomVariableId))
168+
.setValue(conversionCustomVariableValue));
169+
}
170+
171+
CallConversion conversion = conversionBuilder.build();
141172

142173
// Uploads the call conversion to the API.
143174
try (ConversionUploadServiceClient conversionUploadServiceClient =

google-ads-examples/src/main/java/com/google/ads/googleads/examples/remarketing/UploadOfflineConversion.java

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.google.ads.googleads.v8.services.ClickConversion;
2424
import com.google.ads.googleads.v8.services.ClickConversionResult;
2525
import com.google.ads.googleads.v8.services.ConversionUploadServiceClient;
26+
import com.google.ads.googleads.v8.services.CustomVariable;
2627
import com.google.ads.googleads.v8.services.UploadClickConversionsRequest;
2728
import com.google.ads.googleads.v8.services.UploadClickConversionsResponse;
2829
import com.google.ads.googleads.v8.utils.ResourceNames;
@@ -53,6 +54,14 @@ private static class UploadOfflineConversionParams extends CodeSampleParams {
5354

5455
@Parameter(names = ArgumentNames.CONVERSION_VALUE, required = true)
5556
private Double conversionValue;
57+
58+
// Optional: Specify the conversion custom variable ID and value you want to
59+
// associate with the call conversion upload.
60+
@Parameter(names = ArgumentNames.CONVERSION_CUSTOM_VARIABLE_ID)
61+
private Long conversionCustomVariableId;
62+
63+
@Parameter(names = ArgumentNames.CONVERSION_CUSTOM_VARIABLE_VALUE)
64+
private String conversionCustomVariableValue;
5665
}
5766

5867
public static void main(String[] args) {
@@ -66,6 +75,10 @@ public static void main(String[] args) {
6675
params.gclid = "INSERT_GCL_ID_HERE";
6776
params.conversionDateTime = "INSERT_CONVERSION_DATE_TIME_HERE";
6877
params.conversionValue = Double.parseDouble("INSERT_CONVERSION_VALUE_HERE");
78+
// Optionally specify the conversion custom variable ID and value you want to
79+
// associate with the call conversion upload.
80+
params.conversionCustomVariableId = null;
81+
params.conversionCustomVariableValue = null;
6982
}
7083

7184
GoogleAdsClient googleAdsClient = null;
@@ -88,7 +101,9 @@ public static void main(String[] args) {
88101
params.conversionActionId,
89102
params.gclid,
90103
params.conversionDateTime,
91-
params.conversionValue);
104+
params.conversionValue,
105+
params.conversionCustomVariableId,
106+
params.conversionCustomVariableValue);
92107
} catch (GoogleAdsException gae) {
93108
// GoogleAdsException is the base class for most exceptions thrown by an API request.
94109
// Instances of this exception have a message and a GoogleAdsFailure that contains a
@@ -114,6 +129,10 @@ public static void main(String[] args) {
114129
* @param gclid the GCLID for the conversion.
115130
* @param conversionDateTime date and time of the conversion.
116131
* @param conversionValue the value of the conversion.
132+
* @param conversionCustomVariableId the ID of the conversion custom variable to associate with
133+
* the upload.
134+
* @param conversionCustomVariableValue the value of the conversion custom variable to associate
135+
* with the upload.
117136
*/
118137
// [START upload_offline_conversion]
119138
private void runExample(
@@ -122,20 +141,31 @@ private void runExample(
122141
long conversionActionId,
123142
String gclid,
124143
String conversionDateTime,
125-
Double conversionValue) {
144+
Double conversionValue,
145+
Long conversionCustomVariableId,
146+
String conversionCustomVariableValue) {
126147
// Gets the conversion action resource name.
127148
String conversionActionResourceName =
128149
ResourceNames.conversionAction(customerId, conversionActionId);
129150

130151
// Creates the click conversion.
131-
ClickConversion clickConversion =
152+
ClickConversion.Builder clickConversionBuilder =
132153
ClickConversion.newBuilder()
133154
.setConversionAction(conversionActionResourceName)
134155
.setConversionDateTime(conversionDateTime)
135156
.setConversionValue(conversionValue)
136157
.setCurrencyCode("USD")
137-
.setGclid(gclid)
138-
.build();
158+
.setGclid(gclid);
159+
160+
if (conversionCustomVariableId != null && conversionCustomVariableValue != null) {
161+
clickConversionBuilder.addCustomVariables(
162+
CustomVariable.newBuilder()
163+
.setConversionCustomVariable(
164+
ResourceNames.conversionCustomVariable(customerId, conversionCustomVariableId))
165+
.setValue(conversionCustomVariableValue));
166+
}
167+
168+
ClickConversion clickConversion = clickConversionBuilder.build();
139169

140170
// Creates the conversion upload service client.
141171
try (ConversionUploadServiceClient conversionUploadServiceClient =

google-ads-examples/src/main/java/com/google/ads/googleads/examples/utils/ArgumentNames.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public final class ArgumentNames {
4545
public static final String CHAIN_ID = "--chainId";
4646
public static final String CONVERSION_ACTION_ID = "--conversionActionId";
4747
public static final String CONVERSION_ACTION_IDS = "--conversionActionIds";
48+
public static final String CONVERSION_CUSTOM_VARIABLE_ID = "--conversionCustomVariableId";
49+
public static final String CONVERSION_CUSTOM_VARIABLE_VALUE = "--conversionCustomVariableValue";
4850
public static final String CONVERSION_DATE_TIME = "--conversionDateTime";
4951
public static final String CONVERSION_VALUE = "--conversionValue";
5052
public static final String COUNTRY_CODE = "--countryCode";

google-ads/src/main/java/com/google/ads/googleads/v5/common/AdAssetProto.java

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)