To collect performance data from HTML pages formatted for Google's Accelerated Mobile Pages (AMP) project, you must add browser monitoring's AMP agent to your AMP pages. This agent leverages the amp-analytics
agent to define the relevant New Relic events and send them to New Relic to be captured for reporting.
Compatibility and requirements
This private beta is closed. This feature and all related services will be deprecated in July 2021.
In addition to browser monitoring's installation requirements, Browser's AMP agent requires:
Browser AMP requirements | Comments |
---|---|
New Relic Browser | New Relic's browser requirements include Browser Pro account, which includes access to New Relic Insights data depending on your Browser subscription level. |
Browser app ID | To capture AMP throughput, browser monitoring needs the
|
Browser monitoring license key | To obtain only the browser monitoring license key:
|
Install Browser's AMP agent
New Relic has partnered with The Amp Project to incorporate New Relic Browser's AMP agent in with the AMP Analytics repo.
Before installing, read the requirements. To install the Browser AMP agent into your AMP app:
- Add the attribute
newrelic
to your AMP analytics code. For more information, see the AMP site. - Add the browser
app ID
andlicense key
. To send data from one AMP page to multiple Browser apps, include quote marks and a comma to separate each Browserapp ID
. For example:"appId": ["123", "124", "125"]
<amp-analytics type="newrelic" id="newrelic"><script type="application/json"> { "vars": { "appId": "", "licenseKey": "" } }</script></amp-analytics>
Query AMP events
Currently, your AMP data will not appear in the New Relic's browser monitoring UI. This is intentional; any AMP data sent to the New Relic collector will be removed automatically from your browser monitoring metrics.
In the meantime, you can run NRQL queries to compare your AMP page to non-AMP pages. The dashboard data provides standard performance key metrics.
New Relic stores AMP events in the PageView
and BrowserInteraction
events. To view the AMP events, run the following NRQL queries:
SELECT * FROM BrowserInteraction WHERE mobileOptimized = 'amp'
SELECT * FROM PageView WHERE mobileOptimized = 'amp'
Here's an example of a dashboard showing AMP event data after you install New Relic Browser's AMP JavaScript snippet into the body of your AMP pages.
AMP data dictionary
Here's a summary of the AMP data available in BrowserInteraction
and PageView
.
Insights variable | |
---|---|
The New Relic application ID. | Populated by NR AMP agent |
Autonomous System Number: A unique number identifying a group of IP networks that serves the content to the end user. | Derived from IP |
The latitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's latitude. | Derived from IP |
The longitude of the geographic center of the postal code where the Autonomous System Network is registered. This is not the end user's longitude. | Derived from IP |
The organization that owns the Autonomous System Number. Often an ISP, sometimes a private company or institution. | Derived from IP |
The type of interaction: Either initial page load, route change, or custom. | Value: Always page load |
The city in which the event occurred; for example, Portland or Seattle. | From request |
The country from which the browser initiated the interaction. For a list of country codes, see ISO 3166-1 alpha-2. | From request |
The type of device that loaded the page: Either mobile, tablet, or desktop. | Value: Always |
The total duration, in seconds, of the interaction event. |
|
The ungrouped URL in the browser at the start of the interaction. | Always blank ( |
The unique ID for the session in which the event occurred. |
|
The ungrouped URL in the browser at the end of the interaction. |
|
The time, in seconds, from the start of the interaction to the connectStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the connectEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the domComplete, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. | $navTiming(domComplete) |
The time, in seconds, from the start of the interaction to the domContentLoadedEventStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the domContentLoadedEventEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the domInteractive, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the domLoading, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. | $navTiming(domLoading) |
The time, in seconds, from the start of the interaction to the domainLookupStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the domainLookupEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the fetchStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the loadEventStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the loadEventEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the requestStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the responseStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the responseEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the secureConnectionStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the unloadEventStart, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time, in seconds, from the start of the interaction to the unloadEventEnd, as defined by the Navigation Timing API. This attribute exists for initial page load events, not route changes. |
|
The time (date, hour, minute, second) at which the interaction occurred. |
|
The cause of the route change or page load. The default values are click, submit, popstate, or initial page load. For a custom event created with the API, the default value for trigger will be api. This value can also be set via the API. | Possible values: Initial page load, click |
The end user's browser type. | From request |
The end user's browser version. | From request |
The end user's operating system. | From request |
Replace copy/pasted agent with library reference
If you previously copy/pasted browser monitoring's AMP agent JS Snippet onto your AMP pages, you can now pull the snippet from AMP Analytics instead. Remove browser monitoring's AMP agent JS snippet from your AMP pages, and then follow the instructions to install Browser's AMP agent.
For more help
During the beta period, email your AMP feedback to the browser monitoring team.
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。