Google Ads customer_secret authentication

Hey PipeDrive Community,

I am currently implementing an integration with Google Ads, and following their documentation:

`from google.ads.googleads.client import GoogleAdsClient

credentials = {
“developer_token”: “abcdef123456”,
“refresh_token”: “1//0abcdefghijklABCDEF”,
“client_id”: “123456-abcdef.apps.googleusercontent.com”,
“client_secret”: “aBcDeFgHiJkL”}

client = GoogleAdsClient.load_from_dict(credentials)`

Requires developer_token, refresh_token, client_id, and client_secret to work with GoogleAdsClient. I noticed that the authentication object when PipeDream is authenticated with Google Ads does not have the client_secret (for good reason).

So would I need to create my own Google App and figure out a way to get the refresh_token or is there a way to work with Google Ads within PipeDream besides listing account ids?

Hi, have you found an answer?
A month ago I found google ads in pipedream and it helped to add auth the same way it works for other apps. But could not find it again… So solution will be to write everything with auth by myself.

Yep, I did a round about way of doing the request. Google just closed off some of their documentation to v11 so I reference v12.

Below is a sample of what a request would look like.

  dates = ["THIS_MONTH", "TODAY"]
  for d in dates:
    data = {
      "query" : """
        SELECT
          campaign.id,
          campaign.name,
          ad_group.id,
          ad_group.name,
          ad_group_criterion.criterion_id,
          ad_group_criterion.keyword.text,
          ad_group_criterion.keyword.match_type,
          metrics.impressions,
          metrics.average_cpc,
          metrics.conversions, 
          metrics.clicks,
          metrics.ctr,
          metrics.cost_micros
        FROM keyword_view 
        WHERE segments.date DURING {0}
        AND campaign.status = 'ENABLED' 
        AND ad_group_criterion.status = 'ENABLED'
        AND ad_group_criterion.negative = 'FALSE'
        AND metrics.impressions > 0
        ORDER BY metrics.impressions DESC
        LIMIT 50""".format(d)
    }

    r = requests.post('https://googleads.googleapis.com/v12/customers/<ga-id>/googleAds:searchStream', headers=headers, data=data)