Not being able to access version 7 of Ads API

2021-05-04 Thread renan....@wildlifestudios.com
Hello there,

I have been trying to access the v7 of Google Ads API since the release, 
however, I always receive the following message: 

"Specified Google Ads API version "v7" does not exist. Valid API versions 
are: "v6", "v5", "v4""

I already upload the python library "google.ads.googleads.client" and the 
part of the code that is trying to retrieve data from Google is the 
following:

# Google Ads Service
ga_service = client.get_service('GoogleAdsService', version = "v7")

# Query_Google - get info at campaign level
query_campaign_level = ('SELECT campaign.id,'
'campaign.name,'
'segments.sk_ad_network_conversion_value,'
'metrics.sk_ad_network_conversions '
'FROM campaign '
'WHERE  segments.date < %s '
'AND segments.date > %s '
'AND campaign.id = xxx '% 
(str(datetime.now().strftime("%Y%m%d")).replace('-', ''), str(
(datetime.now() - 
timedelta(lookback_window)).strftime("%Y%m%d")).replace('-', '')))

results_campaign = ga_service.search(customer_id = customer_id, 
query=query_campaign_level)

Does anyone know if there is any problem with the v7?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/20f14305-0365-49eb-9445-8b520909d97dn%40googlegroups.com.


Re: Reporting at asset level not bringing asset name for Youtube Videos

2020-07-21 Thread renan....@wildlifestudios.com
Hi everyone,

Thank you for the update. Well, this is quite disappointing since I 
remember being able to retrieve the youtube video name a few weeks ago 
using this same query.
Anyways, do you have any guess when this new version could be released?

On Tuesday, July 21, 2020 at 9:35:32 AM UTC-3 adsapiforumadvisor wrote:

> Hello,
>
> We're not going to be able to make the name field return the name of the 
> YouTube video. However, the team has committed to providing a new field 
> that will include the name of the YouTube video in the asset in a future 
> API release. Please keep an eye out for new version announcements on our 
> blog  .
>
> Regards,
> Mike, Google Ads API Team
>
> ref:_00D1U1174p._5004Q22Xdo6:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f733dea0-578f-437b-a85e-5b10877c22f7n%40googlegroups.com.


Reporting at asset level not bringing asset name for Youtube Videos

2020-07-20 Thread renan....@wildlifestudios.com
Hi everyone,

I was wondering why when I try to extract the asset name of Youtube videos 
using the query attached to the email, what I receive is the following 
output:


*Query preview:*
query = ('SELECT asset.name, asset.youtube_video_asset.youtube_video_id 
FROM asset '
   'WHERE asset.type = \'YOUTUBE_VIDEO\' ')

  results = ga_service.search(customer_id, query=query, page_size=page_size)

  try:
  count = 0
  for row in results:
  asset = row.asset
  count += 1
  print(f'Video with name "{asset.name}"')
  print(f'Video with ID 
"{asset.youtube_video_asset.youtube_video_id}"')
  print(f'Total of {count} videos(s) found.')


*Output:*
Video with name ""
Video with ID value: "8X8
Video with name "" 
Video with ID "value: "ZXY"
Video with name "" 
Video with ID "value: "BXo" 
Video with name "" 
Video with ID "value: "JXY"

You can observe that only the video ID is returned and the name of the 
video returns empty always. In the case of changing the where filter from :
asset.type = \'YOUTUBE_VIDEO\'  to asset.type = \'IMAGE\' or even 
asset.type = \'MEDIA_BUNDLE\'the name field name always returns the correct 
name of the asset.

So my question is: Why is this happening only with videos? Is there a 
problem in the API or it's programmed to not return the name of youtube 
video asset? And finally, how can I retrieve the name of my youtube videos 
that are currently running in my App Campaigns?


Best


 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/eef47fc1-a665-4bf0-8815-ac6736e8e3a0n%40googlegroups.com.
# print("===\n")
# print("===\n")
# print("  Collecting Data\n")
# print("==\n")
# print("==\n")

 
# DataFrame
data = []

def main(client, customer_id, page_size):
  
  #Google Ads Service

  ga_service = client.get_service('GoogleAdsService', version='v3')

  query = ('SELECT asset.name, asset.youtube_video_asset.youtube_video_id FROM asset '
   'WHERE asset.type = \'YOUTUBE_VIDEO\'')

  results = ga_service.search(customer_id, query=query, page_size=page_size)

  try:
  count = 0
  for row in results:
  asset = row.asset
  count += 1
  print(f'Video with name "{asset.name}"')
  print(f'Video with ID "{asset.youtube_video_asset.youtube_video_id}"')
  print(f'Total of {count} videos(s) found.')

  except google.ads.google_ads.errors.GoogleAdsException as ex:
print('Request with ID "%s" failed with status "%s" and includes the '
  'following errors:' % (ex.request_id, ex.error.code().name))
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print('\t\tOn field: %s' % field_path_element.field_name)

# Start code -
for customer_id in accounts:
  
  if __name__ == '__main__':

  # GoogleAdsClient will read the google-ads.yaml configuration file in the
  # home directory if none is specified.
  google_ads_client = (google.ads.google_ads.client.GoogleAdsClient
   .load_from_storage(yaml_path))

  main(google_ads_client, customer_id = customer_id, page_size = 1000)


print("\n\n ALL TASKS COMPLETED! \n\n")