Export Trends Data to a CSV
Last updated: 29th October, 2020
Export your data as CSV without writing any code. You can easily download any of the the data displayed in the widgets on the Trends and Ecommerce dashboards.
Login in to your GoSquared account and navigate to either the Trends or Ecommerce dashboard.
Use the date range selector in the top right hand corner of your dashboard to choose which day/month/year that you'd like to export.
- Then just hit the download arrow icon on the top right corner of the widget(s) you would like to export.
- This will trigger a CSV file containing the widgets data to download. You can then open the CSV in Excel or Google sheets!
This is a quick hack that uses the Query Builder to allow you to download your data so you can use it in Google Sheets or elsewhere. It's a bit fiddly but it's currently the easiest way to export data over a custom time frame.
This example uses the 'Pages' API endpoint which will give you the same data that is displayed in the 'Content' widget in the Trends dashboard.
If you just want to know the total number pageviews/visits/visitors etc then follow the same steps but use the Aggregate endpoint instead.
- Log in to your GoSquared account.
- Head to API Access in your Account Settings.
- Click Add a new API Key, give it a memorable name and then toggle 'ON' the the Read Now, Read Trends and Read Ecommerce permissions.
- Next we'll head to the GoSquared API documentation. In this example we use the Pages endpoint which will give us the same information as the Content widget in the Trends dashboard.
- Click Open Query Builder on the right hand side on the page. This will present you with several options.
- Select the API key you just created, then select the token for the site you want to export data for.
- Next you'll need to set the date range for the time period that you want to export data for. It should be in the format YYYY-MM-DD.
- Set the format to csv , choose how many results you want to export, e.g. just the top 10 most popular pages, or the top 20 etc. Choose sort by 'visits'.
- When you're happy with the options, copy the long URL from the Example Request to the clipboard.
- Open a new tab in your browser and paste in URL.
- Delete the word curl and remove the quotation marks "" from either end of the URL.
- Finally hit Enter to load the URL. This will trigger a CSV to download that contains your data.
You can follow this process for any of the other data in the Trends dashboard. Just re-open the Query Builder on the API endpoint that you want to get data from.
📊 Looking for a way to run insightful, visual reports on your data? Check out our integration with Google Data Studio, and bring your data to life!