Embed in a secure portal
Prerequisites
To use the Embed option, ensure that the following requirements are met:
-
Your internal portal is secure and has a mechanism for managing user access.
-
You have subscribed to a pricing plan that provides the Embed option for the page you want.
Getting started
This section explains how to embed Agora Analytics pages in your portal using the Embedding Configuration dialog.
To access Embedding Configuration, do the following:
-
Log in to Agora Console.
-
On the left navigation panel, click Agora Analytics, then click the name of the feature page you want to embed (for example, Call Inspector).
-
Click the floating button on the right side, and click Embed.
1. Request the URL for Embed
Send an HTTP request from your server to query the URL that opens the Agora Analytics feature page you want to embed. A feature page is the page you access directly from the left navigation panel of Agora Analytics in Agora Console.
The Embedding Configuration dialog shows a code sample for Node.js:
HTTP request
-
Format: JSON
-
Method: POST
-
Endpoint:
https://analytics-lab.agora.io/api/getEmbedLocations
-
Authentication: Use
clientId
andclientSecret
to generate theAuthorization
parameter in the HTTP request header. To get yourclientId
andclientSecret
, click Apply above the code snippet in the dialog. -
Request body parameter:
feature
, which represents the Agora Analytics feature page you want to embed. You can set it to one of the following options: -
callSearch
: The Call Inspector page. -
dataInsightUsage
: The Usage Overview page. -
dataInsightQuality
: The Quality Overview page. -
realtimeMonitoring
: The Real-time Monitoring page. -
notificationManage
: The Alert Notifications page.
HTTP response
The response is in JSON format and returns the URL to the feature page you request. For example, if your request specifies feature
as callSearch
, the response looks like this:
The token
parameter is a dynamic key that expires in two hours. You need to renew it every two hours.
If you want to request the URL to a detailed Call Inspector page, see URL to a detailed Call Inspector page.
2. Customize the URL (Optional)
You can customize the content in the embedded Agora Analytics page using the Page Attributes panel. Settings in the panel are transformed into parameters in the code snippet in real time, and these parameters are appended to the URL you get from Request the URL for Embed.
For example, if you select English for Language, &locale=en
is appended to the URL.
The following table lists each setting in Page Attributes and their corresponding parameters in the code snippet:
Setting | Setting description | Parameter | Parameter Description |
---|---|---|---|
Language |
The language of the report. |
|
|
Time Zone |
The timezone used in the report. |
|
|
Project Permission |
All projects: Users can access reports of all projects where the specified Specify a project by code: Users can only access reports of the project you select as Default Project. |
|
Whether to show the project selector:
|
Default Project |
The default project displayed in the report. |
(Optional) |
The ID of the project. Set this parameter only when |
3. Embed the URL
-
Select a development framework from the dropdown menu.
-
Copy the code snippet, and replace
iframeUrl
with the final complete URL you get from previous steps.
See also
URL to a detailed Call Inspector page
To get the URL to a detailed Call Inspector page, append the following parameters to this URL: https://analytics-lab.agora.io/api/analytics/research
:
-
token
: Thetoken
parameter returned in 1. Request the URL for Embed when you setfeature
ascallSearch
. -
cname
: The channel name. If you enter an invalid channel name, you see a call search page with no research result.
If you only append token
and cname
to the URL, the embedded page displays the call search results for the last three days. To get a more detailed page, you can append the following optional parameters:
-
fromUid
: The user ID of the local client. -
toUid
: The user ID of the remote client. -
fromTs
: The start point (Unix timestamp) of the time frame to query. -
toTs
: The end point (Unix timestamp) of the time frame to query.
For example:
FAQ
Q: Why is the embedded page blank in my web portal?
A: Your browser may block the page due to security concerns. You can try the following solutions:
-
If your browser has an ad blocker, set the ad blocker to stop blocking the embedded page.
-
If you are using Safari, go to Preferences > Privacy, and select Prevent cross-site tracking.