Programmatically create new projects and share them with users
This support doc covers how to add multiple projects in GoSquared programmatically with the GoSquared API. This doc is for anyone that wants to integrate hundreds of sites at once or offer GoSquared Analytics to their customers.
With the GoSquared API you can programmatically create new projects and share them with new users.
For example, if you want to integrate GoSquared with your website building platform, you can use the GoSquared Account API to create tracking codes for each site on your platform. With this integration, every time a new user creates a new site on your platform, you can create a new project in GoSquared, generate a tracking code and invite that user to the project. You can also use this integration to embed a GoSquared dashboard for the site in your own admin portal or area.
This functionality can be extremely powerful and is available to all GoSquared customers at no extra cost. Customers use this feature to integrate 1000s of sites at a time.
Note: this guide is intended for developers.
Creating a new project/site with the API
The first step is to create a new project and the docs can be found here: gosquared.com/developer/api/account/v1/sites/post/
Please note, this is a
Note on Timezones
When posting to the API endpoint the new project's default timezone will be set to GMT (UTC).
If you know the timezones of your users you can set the timezone by appending
&timezone=TIMEZONE to the API call.
A list of Timezones can be found here.
Sharing the data with your users
Create a shared account
Once you have created a project, you can use the
sharedUsers function to add that user to the project so they can access their own analytics. To understand how shared users work in GoSquared, see our doc here.
Create a new shared user under your GoSquared account and share the site with them. Shared users can access all the features of GoSquared, including email reports. You can add multiple users to the same site or share multiple sites with one user.
sharedUsers function allows you to add and remove shared users with the API.
Embed the GoSquared Dashboard
Show the GoSquared dashboard in your own user admin area. The embed works as an iframe and it will allow you to give your users a fully functional analytics dashboard with minimal work on your end.
Use the API to power custom visualisations
Use the GoSquared Now and Trends API to build your own custom visualisations. This option offers the most flexibility and will allow you to supplement GoSquared analytics data with additional data that you might have.