|
@@ -39,11 +39,11 @@ public class GoogleAdsService {
|
|
|
try (GoogleAdsServiceClient googleAdsServiceClient =
|
|
|
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
|
|
|
|
|
|
-
|
|
|
+
|
|
|
String customerQuery =
|
|
|
"SELECT customer.descriptive_name, customer.currency_code, customer.optimization_score, "
|
|
|
- + "metrics.cost_micros "
|
|
|
- + "FROM customer WHERE segments.date DURING YESTERDAY";
|
|
|
+ + "metrics.conversions, metrics.cost_micros "
|
|
|
+ + "FROM customer";
|
|
|
ApiFuture<SearchPagedResponse> customerResponse =
|
|
|
googleAdsServiceClient
|
|
|
.searchPagedCallable()
|
|
@@ -82,13 +82,15 @@ public class GoogleAdsService {
|
|
|
.sum();
|
|
|
|
|
|
return CustomerStatsDTO.builder()
|
|
|
+ .customerId(customerId)
|
|
|
.descriptiveName(customerResult.getCustomer().getDescriptiveName())
|
|
|
.currencyCode(customerResult.getCustomer().getCurrencyCode())
|
|
|
+ .conversions(customerResult.getMetrics().getConversions())
|
|
|
+ .costMicros(customerResult.getMetrics().getCostMicros())
|
|
|
|
|
|
.balanceMicros(balanceMicros)
|
|
|
- .yesterdayCostMicros(customerResult.getMetrics().getCostMicros())
|
|
|
|
|
|
- .optimizationScore(customerResult.getCustomer().getOptimizationScore())
|
|
|
+ .optiScore(customerResult.getCustomer().getOptimizationScore())
|
|
|
.build();
|
|
|
} catch (InterruptedException | ExecutionException e) {
|
|
|
log.error(e.getMessage());
|