Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I wonder if anyone has an idea how to dynamically pull GA data from entire previous month?
My load script is using the specific URI query from API:
4_Q%26start-date%3d$(vGoogleMinQueryDate)%26end-date%3d$(vGoogleMaxQueryDate)&appID
In order to set those two variables I was trying
SET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');
SET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');
But that way, it returns that entire string as variable while Google expects something like '2022-10-01' / '2022-10-31'.
I believe it must be a simple fix - does anyone has an idea?
Many thanks,
Joerg
Ah - my inexperience led me to above´s question - actually I just figured a solution it´s LET rather than SET ;):
LET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');
LET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');
So that seems to do the job!
Ah - my inexperience led me to above´s question - actually I just figured a solution it´s LET rather than SET ;):
LET vGoogleMinQueryDate = date(monthstart(Today(), -1),'YYYY-MM-DD');
LET vGoogleMaxQueryDate = date(monthend(Today(), -1),'YYYY-MM-DD');
So that seems to do the job!