Hey everybody! I need some help with `tap-googlead...
# singer-taps
t
Hey everybody! I need some help with
tap-googleads
. I'm having trouble trying to use the custom query feature, I've added the required configs to the yml but the Stream is not being recognized.
Copy code
- name: tap-googleads
    variant: matatika
    pip_url: git+<https://github.com/Matatika/tap-googleads>
    config:
      start_date: '2025-10-28'
    custom_queries:
    - name: gads_ads_performance_custom
      query: 'SELECT ad_group_ad.ad.expanded_text_ad.headline_part1, ad_group_ad.ad.expanded_text_ad.headline_part2, ad_group_ad.ad.expanded_text_ad.headline_part3, a>
      primary_keys: [ad_group_ad.ad.name, segments.date]
      replication_key: segments.date
Does anybody use this feature or has had similar trouble before?
1
r
Hi, yes - we have this feature running in production for a customer. Can you see the stream/is the stream selected in the output of
Copy code
meltano select tap-googleads --list --all
?
Your YAML looks malformed, but maybe that is just a copy-paste error.
t
No, the stream doesn't show up when I run the select. ANd about the malformed YAML it was only a copy-paste error in fact
Sorry everybody, i think it was just a dumb formatting error
r
Oh, I see the problem. You need to indent
custom_queries
one more level so it is under
config
.
I think you got there yourself 😅
t
Yes! Thank you for the attention! I was editing the YAML properly to send it here when I realized 😅
r
Note that primary key(s)/replication key have to be top-level properties, so
tap-googleads
does automatic flattening to allow use of these. With your configuration, that means you have to reference nested properties with
__
instead of
.
, i.e.
Copy code
custom_queries:
      - name: "ad_group_performance"
        query: >
          SELECT 
            customer.resource_name,
            customer.id, 
            bidding_strategy.resource_name,
            bidding_strategy.id, 
            ad_group.resource_name,
            ad_group.labels, 
            ad_group.ad_rotation_mode, 
            ad_group.effective_target_cpa_micros, 
            segments.ad_network_type, 
            campaign.resource_name,
            campaign.id, 
            segments.device, 
            ad_group.id, 
            ad_group.effective_target_cpa_source, 
            campaign.name, 
            ad_group.name, 
            customer.descriptive_name, 
            ad_group.effective_target_roas_source, 
            ad_group.status, 
            ad_group.cpc_bid_micros, 
            ad_group.effective_target_roas, 
            campaign.bidding_strategy_type, 
            bidding_strategy.name,
            segments.date
          FROM ad_group
        add_date_filter_to_query: true
        replication_key: "segments__date"
        replication_method: "INCREMENTAL"
        primary_keys: ["adGroup__id","segments__ad_network_type","segments__date","segments__device"]
t
Oh, ok! Thank you so much! That probably would've taken me a while to figure out on my own
np 1
r
Copy code
meltano select tap-googleads --list --all
should help you figure out the available properties that you can use as the primary key(s)/replication key, since the tap works with names as returned by the API (sometimes camelCase, sometimes snake_case), rather than as specified in the query (always snake_case, as far as I am aware).
It's pretty weird, so if you are knowledgeable around the Google Ads and have any improvements in mind, please open an issue or PR if you feel so inclined! 😅