@amplitude/plugin-page-url-enrichment-browser

中文文档
0.7.36发布于 2026/11/07MITTypeScriptESM + CJS构建来源已验证近 30 天下载 828.7万
原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. 1. Import Amplitude packages
  4. 2. Instantiate page url enrichment plugin
  5. 3. Install plugin to Amplitude SDK
  6. 4. Initialize Amplitude SDK
  7. Resulting Page URL properties


@amplitude/plugin-page-url-enrichment-browser

Official Browser SDK plugin for page url enrichment

Installation

This package is published on NPM registry and is available to be installed using npm and yarn.

# npm
npm install @amplitude/plugin-page-url-enrichment-browser

# yarn
yarn add @amplitude/plugin-page-url-enrichment-browser

Usage

This plugin works on top of Amplitude Browser SDK and adds page url enrichment properties to all events. To use this plugin, you need to install @amplitude/analytics-browser version v2.0.0 or later.

1. Import Amplitude packages

  • @amplitude/plugin-page-url-enrichment-browser
import { pageUrlEnrichmentPlugin } from '@amplitude/plugin-page-url-enrichment-browser';

2. Instantiate page url enrichment plugin

const pageUrlEnrichment = pageUrlEnrichmentPlugin();

Options

3. Install plugin to Amplitude SDK

amplitude.add(pageUrlEnrichment);

4. Initialize Amplitude SDK

amplitude.init('API_KEY');

Resulting Page URL properties

This plugin adds Page URL properties to all events based on your configuration

Event type

  • No event type added

Event properties

PropertyDescription
'[Amplitude] Page Domain'The website's hostname or location.hostname
'[Amplitude] Page Location'The website's full url or location.href
'[Amplitude] Page Path'The website's pathname or location.pathname
'[Amplitude] Page Title'The website's title or document.title
'[Amplitude] Page URL'The website's url excluding query parameters
'[Amplitude] Previous Page Location'The URL of the previous page the user visited; document.referrer if coming from an external domain; and using the sessionStorage which tracks the last url otherwise
'Amplitude] Previous Page Type'A classification of the previous page (e.g., 'Internal', 'External', 'Direct'), typically derived from a custom function that analyzes the previous page's URL

版本与发布记录

@amplitude/plugin-page-url-enrichment-browser 共发布 117 个版本,首次发布于 2025/08/06;过去 12 个月发布了 92 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.7.36latest2026/11/071 天前
0.7.36-sr-bfcache-pageshow-snapshot.02026/11/052 天前
0.7.352026/10/317 天前
0.8.0-video-analytics-8.02026/10/2811 天前
0.8.0-video-analytics-7.02026/10/2712 天前
0.7.35-codexsemantic-review-integration.02026/10/2315 天前

其他发布通道:SR-1975 → 0.5.2-SR-1975.0,zen-observable-migration → 0.5.3-zen-observable-migration.0,zen-plus-zoning → 0.5.3-zen-plus-zoning.2,pnpm-migration → 0.5.10-pnpm-migration.0,feat-zoning-010526 → 0.5.10-feat-zoning-010526.0,fake-branch-1141 → 0.5.10-fake-branch-1141.0。

关于 @amplitude/plugin-page-url-enrichment-browser 的常见问题

如何安装 @amplitude/plugin-page-url-enrichment-browser?

在项目目录运行 npm install @amplitude/plugin-page-url-enrichment-browser,或使用 pnpm add / yarn add / bun add。

@amplitude/plugin-page-url-enrichment-browser 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@amplitude/plugin-page-url-enrichment-browser 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@amplitude/plugin-page-url-enrichment-browser 可以商用吗?

@amplitude/plugin-page-url-enrichment-browser 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@amplitude/plugin-page-url-enrichment-browser 的下载量有多少?

根据 npm 官方下载统计,@amplitude/plugin-page-url-enrichment-browser 在 2026/10/06 – 2026/11/04 这 30 天内被下载 8,287,094 次,日均约 276,236 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@amplitude/plugin-page-url-enrichment-browser 还在维护吗?

最新版本 0.7.36 发布于 2026/11/07(1 天前);至今共发布 117 个版本,其中过去 12 个月发布了 92 个;首次发布于 2025/08/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。