Opteo / google-ads-api

Google Ads API client library for Node.js
https://opteo.com
MIT License
270 stars 90 forks source link

segments.sk_ad_network_attribution_credit is missing when requested. #411

Closed laskdkmg closed 2 years ago

laskdkmg commented 2 years ago

Hi team,

When I ran the query below, there is not segments.sk_ad_network_attribution_credit in the return results.

const campaigns = await customer.report({
   entity: "campaign",
   metrics: ["metrics.sk_ad_network_conversions"],
   segments: [
    "segments.date",
    "segments.sk_ad_network_conversion_value",
    "segments.sk_ad_network_ad_event_type",
    "segments.sk_ad_network_source_app.sk_ad_network_source_app_id",
    "segments.sk_ad_network_user_type",
    "segments.sk_ad_network_attribution_credit"
   ],
   attributes: ["campaign.id", "campaign.name"],
   constraints: [
      {
        "key": "segments.sk_ad_network_source_app.sk_ad_network_source_app_id",
        "op": "!=",
        "val": "NULL"
      }
   ],
   date_constant: "LAST_7_DAYS"
 });

Here is the SS of the result.

And there is the return when I called the Google Ads V10/V11 REST api.

The curl I used.

curl -X POST \
  'https://googleads.googleapis.com/v10/customers/xxxxx/googleAds:searchStream' \
  --header 'User-Agent: Thunder Client (https://www.thunderclient.com)' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'developer-token: xxxxx' \
  --header 'login-customer-id: xxxxx' \
  --header 'Authorization: Bearer xxxxx' \
  --data-raw '{
  "query": "    SELECT\n        campaign.id,\n        campaign.name,\n        segments.date,\n        segments.sk_ad_network_conversion_value,\n        segments.sk_ad_network_ad_event_type,\n        segments.sk_ad_network_source_app.sk_ad_network_source_app_id,\n        segments.sk_ad_network_user_type,\n        segments.sk_ad_network_attribution_credit,\n        metrics.sk_ad_network_conversions\n        FROM campaign\n    WHERE\n        segments.sk_ad_network_source_app.sk_ad_network_source_app_id IS NOT NULL\n        AND segments.date DURING LAST_30_DAYS"
}'

I use ^11.0.0 of this lib, Can you support me to find the root cause of this and suggest me the next step I should take? Thanks!

lushu commented 2 years ago

By using the latest version libs (google-ads-api v11.0.0 and google-ads-node v9.0.0), you actually can get that column.