With the Embed option, you can easily embed Agora Analytics pages in internal web portals using a low-code approach.
To use the Embed option, ensure that the following requirements are met:
This section explains how to embed Agora Analytics pages in your portal using the Embedding Configuration dialog.
To access Embedding Configuration, do the following:
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:
clientId
and clientSecret
to generate the Authorization
parameter in the HTTP request header. To get your clientId
and clientSecret
, click Apply above the code snippet in the dialog.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 Notificationss page.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:
https://analytics-lab.agora.io/analytics/call/search?token=xxxxxxxxxxxxxxxxxxxxxx
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.
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 1. 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. | locale |
zh : Chinese.en : English. |
Time Zone | The timezone used in the report. | timezone |
Local : The local timezone.UTC : The UTC timezone. |
Project Permission | feature is enabled . |
showProjectSelector |
Whether to show the project selector: true : Show the project selector.false : Do not show the project selector. |
Default Project | The default project displayed in the report. | (Optional)projectId |
The ID of the project. Set this parameter only when showProjectSelector is false . |
iframeUrl
with the final complete URL you get from previous steps. 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
: The token
parameter returned in 1. Request the URL for Embed when you set feature
as callSearch
.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:
https://analytics-lab.agora.io/api/analytics/research?token=xxxxxxxxxxxxxxxxxxxxxx&cname=xxxxxxxxxxxxxxxxxxxxxxxx&fromUid=xxxxxx&toUid=xxxxxx
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: