Google Analytics Query Dynamic Dates

In Google Analytics, you have the option of pulling last 7 days, last 14 days, etc. nk the google analytics query node, that relative option doesn’t appear to exist. Additionally, it doesn’t appear that I can create a flow variable to dynamically pass through a from and to date based on upstream calculations to create that dynamic moving XX days window. How can I create a relative date range in the Google analytics query? Or do I have to go in daily and change the date range?

Looking at ga-dev-tools for GA4, you can overwrite the start end with “ndaysAgo” and “yesterday”, but in the connector, I can’t seem to create a text, only a calendar date select:

Please let me know if anyone has solved for this.

Hi @ebarr ,

Thanks for your post.

Which KNIME AP version are you using? I am using KNIME AP 5.2.0 and I can control the “From date” and “To date” configuration parameters via flow variables. See the screenshot below :framed_picture:

Let me know if we can further support you with your question.

Hi @ebarr,

relative date inputs are currently not supported by the node. You would have to calculate the specific dates in the workflow (using the same timezone as the Google Analytics property) and provide them as string variables formatted like absolute dates as shown in the ga-dev-tools.

I have created an internal ticket (AP-22147) to enhance the node.

Best,
Manuel

3 Likes

I"ve been able to change the dates using a flow variable.


created an ‘automated’ start / end by creating a date for ‘today’, then date time shift by -1 and -X days ago and name then startdate and endDate


1 Like