How would you automate that Wordpress + Google analytics?

Hey there Parabola community!

I’m trying to create a simple dashboard: When a new article is published on WordPress create a new row in a google sheet then pull the google analytics data for the following periods: 0-7 days since published, 8-15days, 16-30 days and more…

So far I’ve been able to match slug and pull the data from wp API but I’m not sure how to work with the dates and then presenting it in a single sheet:

Anyone did something similar?

Best regards

2 Likes

Hey Olivier! Here are the various steps I’d use to accomplish the date categorizations you described:

  1. Use the Add Date & Time step to add the current date stamp as a new column to your flow. This is the column you’ll use to compare dates and calculate the number of days since published
  2. Use the Date Comparison step to calculate the number of days between current day and published day
  3. You can use the Date Formatter step to reformat the date to your preferred style
  4. Finally, I would use the If/Else step to build the conditional logic to bucket your articles by the following periods: 0-7 days since published, 8-15days, 16-30 days, etc

Let me know how that goes!