Creating Analytics Space Session

Intro #

When your user wants to access their data in order to run reports or view dashboards, you will have to create an Analytics Space Session.

These sessions are short lived and scoped sessions. Simply create an Analytics Space session and forward the user to the URL in the response.

Create Session #

You can easily create the analytics space session. The result from the server will contain one attribute that we are interested in which is the Url. Once you have the Url, send the user to that Url provided by TrackZero and they can start using the platform.
					// In order for your customer to run analytics on the data, we need to create a session key then redirect them to the TrackZero Spaces portal.
// We will need to specify the custoemr space id and the duration of the session. In this case the duration is 30 minutes.
// the session duration cannot be less than 5 minutes or longer than 60 minutes.
var session = await trackZeroClient.CreateAnalyticsSpacePortalSessionAsync(analyticsSpaceId, TimeSpan.FromMinutes(30));
// redirect the user to the url stored in session.OperationData.Url or continue reading for more scenarios

Using the AnalyticsSpacePortalSession #

The session variable from above contains a group of useful properties. The properties will help you either redirect the user to TrackZero or embed TrackZero into your website using IFrame.

Both EmbeddedDashboarsdUrl and EmbeddedReportsUrl will REMOVE the following from TrackZero:

  1. The navigation bar.
  2. All Padding & Margins from all sides of the page.

This allows you to add your navigation bar on your main page and manage margins of the iFrame to achieve the maximum visible area. The pages are fully responsive and support mobile views.
					// To redirect the user to TrackZero website, use the Url property stored in session.OperationData.Url as the redirect to Url.
// In a controller GET Method, you can use:
return Redirect(session.OperationData.Url);

// To embed TrackZero reports page in your website, you can add an IFrame tag to your view and use the URL session.OperationData.EmbeddedReportsUrl
<iframe src="{session.OperationData.EmbeddedReportsUrl}" title="TrackZero Reports"></iframe>

// To embed TrackZero Dashboards page in your website, you can add an IFrame tag to your view and use the URL session.OperationData.EmbeddedDashboarsdUrl
<iframe src="{session.OperationData.EmbeddedDashboarsdUrl}" title="TrackZero Dashboards"></iframe>

Delete a Session #

Sessions automatically expire and get removed. No action is necessary from your side.