hi all, I’m running tap-google-analytics, is there...
# troubleshooting
p
hi all, I’m running tap-google-analytics, is there any way, I can rename a dimension that I get from GA. Right now I have
Page Tracking
which I want to be like
Page_Tracking
as I am using
target-athena
which fails on
Page Tracking
because of space in the name
s
Renaming is a great usecase for mappers. If you're using the meltanolabs variant (the default one) you have the "stream maps" capability at your hands. So you can simply provide a renaming map.
A renaming stream map would look like this:
config:
stream_maps:
PROD-SLACK_NOTIFICATIONS-SLACK_ALERTS:
TITLE: null
title: TITLE
BODY: null
body: BODY
p
thanks for the quick reply, I’ll try it out
s
Yep, I'll CC @pat_nadolny and @edgar_ramirez_mondragon because I'm not entirely sure how to handle the space in the config, just in case you hit another problem.
p
Copy code
config:
      reports: extract/ga-data.json
      stream_maps:  { "Page Tracking": { "__alias__": "Page_Tracking" },}
awesome — works like a charm!! @Sven Balnojan thanks
still not sure how to get this into yaml config
but the json works
e
The yaml config shouldn't be too different, fewer quotes at least:
Copy code
config:
      reports: extract/ga-data.json
      stream_maps:
        "Page Tracking":
          __alias__: Page_Tracking
s
@prakhar_srivastava I'm curious, did you try out the YAML version and did it work?
p
oh I’ll give this a go, I was missing the quotes on “Page Tracking” — makes so much sense 😂
For some reason, this didn’t work for Google Sheets plugin, neither yaml nor json
s
@prakhar_srivastava, but "Page Tracking" did work in the YAML for the tap-google-analytics right? And now you tried the same for the Google Sheets plugins for renaming and it did not work? Mind sharing your config again?
p
@prakhar_srivastava only SDK based plugins support stream maps so if youre using the singer-io variant of gsheets then its not supported. You have a variety of options though: • set them on the target side if youre using an SDK target • use a mapper plugin between your tap and target • It looks like there is a matatika variant built on the SDK that you can consider using instead https://hub.meltano.com/extractors/tap-google-sheets--matatika/
p
@pat_nadolny thanks for this, we used on the target side, works 🙂