jeepers mcface
jeepers mcface

Reputation: 419

Why aren't dates importing into Google Data Studio Connector?

I am building a Data Connector from Facebook Ads to Google Data Studio (more as an project than anything else) and I'm able to pull all the data successfully and import the proper fields into Google Data Studio. The only thing that seems amiss is that the date values do not import.

Per the documentation, I have created a field like this:

fields.newDimension()
    .setId('date_stop')
    .setName('Date Stop')
    .setType(types.YEAR_MONTH_DAY);

And I can see it appears in my data schema like so:

[{semantics={semanticType=TEXT, conceptType=DIMENSION}, label=Ad ID, name=ad_id, dataType=STRING}, 
{label=Campaign Name, dataType=STRING, name=campaign_name, semantics={conceptType=DIMENSION, semanticType=TEXT}}, 
{semantics={conceptType=DIMENSION, semanticType=TEXT}, name=adset_name, label=Adset Name, dataType=STRING}, 
{name=cost_per_unique_click, label=Cost per Unique Click, semantics= {isReaggregatable=true, semanticType=NUMBER, conceptType=METRIC}, dataType=NUMBER}, 
{name=date_stop, semantics={semanticType=YEAR_MONTH_DAY, conceptType=DIMENSION}, label=Date Stop, dataType=STRING}]

And it is in the same order within the data schema as the values I am importing:

{values=[ad_id, campaign_name, adset_name, cost_per_unique_click, 2019-06-02]}

Could my date data be in the wrong format? It's basically a string like '2019-06-02' and it's obviously in the same order (YEAR_MONTH_DATE). Why are my date values showing up as null in Google Data Studio?

Upvotes: 0

Views: 178

Answers (1)

jeepers mcface
jeepers mcface

Reputation: 419

Apparently Google Data Studio only accepts date data without hyphens so what was "2021-06-18" should be "20210618." Make it all numbers and you're all good. I wish their documentation was clearer about that...

Upvotes: 0

Related Questions