2.3.4 • Published 2 months ago

@amplitude/plugin-page-view-tracking-browser v2.3.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@amplitude/plugin-page-view-tracking-browser

Official Browser SDK plugin for page view tracking

Installation

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

# npm
npm install @amplitude/plugin-page-view-tracking-browser

# yarn
yarn add @amplitude/plugin-page-view-tracking-browser

Usage

This plugin works on top of Amplitude Browser SDK and adds page view tracking features to built-in features. To use this plugin, you need to install @amplitude/analytics-browser version v2.0.0 or later.

1. Import Amplitude packages

  • @amplitude/plugin-page-view-tracking-browser
import { pageViewTrackingPlugin } from '@amplitude/plugin-page-view-tracking-browser';

2. Instantiate page view plugin

The plugin accepts an optional parameter of type Object to configure the plugin based on your use case.

const pageViewTracking = pageViewTrackingPlugin({
  trackOn: undefined,
  trackHistoryChanges: undefined,
});

Options

NameTypeDefaultDescription
trackOn"attribution" or () => booleanundefinedUse this option to control when to track a page view event. By default, a page view event is sent on each SDK initialization.Use () => boolean to control sending page view events using custom conditional logic.Use "attribution" to send page view events with attribution events. This option requires using @amplitude/plugin-web-attribution-browser.
trackHistoryChanges"all" or "pathOnly"undefinedUse this option to subscribe to page view changes based on full URL or URL path in a single page application like React.js. By default, page view changes are based on full URL.Use "all" to compare the full url changes.Use "pathOnly" to compare only url path changes.

3. Install plugin to Amplitude SDK

amplitude.add(pageViewTracking);

4. Initialize Amplitude SDK

amplitude.init('API_KEY');

Resulting page view event

This plugin tracks page views based on your configuration. A page view event is composed of the following values:

Event type

  • "[Amplitude ]Page Viewed"

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
2.3.4

2 months ago

2.3.3

3 months ago

2.3.0

3 months ago

2.3.2

3 months ago

2.3.1

3 months ago

2.2.22

4 months ago

2.2.21

4 months ago

2.2.17

6 months ago

2.2.18

5 months ago

2.2.15

6 months ago

2.2.16

6 months ago

2.2.13

7 months ago

2.2.14

6 months ago

2.2.12

7 months ago

2.2.19

4 months ago

2.2.20

4 months ago

1.0.13

7 months ago

2.2.11

7 months ago

2.2.10

7 months ago

2.2.9

8 months ago

2.2.8

8 months ago

2.2.7

8 months ago

2.2.7-beta.0

8 months ago

2.2.6

9 months ago

2.2.6-beta.0

9 months ago

2.2.5

9 months ago

2.2.4

9 months ago

2.2.3

10 months ago

2.2.2

10 months ago

2.2.1

10 months ago

2.2.0

10 months ago

2.1.1

11 months ago

2.1.0

11 months ago

2.0.18

1 year ago

1.0.12

1 year ago

2.0.17

1 year ago

2.0.16-beta.0

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

2.0.3

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.13

1 year ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.10

1 year ago

1.0.10

1 year ago

1.0.6

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-beta.10

2 years ago

2.0.0-beta.9

2 years ago

2.0.0-beta.8

2 years ago

2.0.0-beta.7

2 years ago

2.0.0-beta.1

2 years ago

2.0.0-beta.6

2 years ago

2.0.0-beta.5

2 years ago

2.0.0-beta.4

2 years ago

2.0.0-beta.3

2 years ago

1.0.0-beta.1

2 years ago

0.8.1

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.5.7

2 years ago

0.6.0-beta.4

2 years ago

0.6.0-beta.3

2 years ago

0.6.3

2 years ago

0.6.2-beta.0

2 years ago

0.6.1-beta.0

2 years ago

0.6.0-beta.0

2 years ago

0.6.2

2 years ago

0.6.1-beta.1

2 years ago

0.6.0-beta.2

2 years ago

0.5.6

2 years ago

0.6.0-beta.1

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.5-beta.0

2 years ago

0.5.4

2 years ago

0.5.5

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.3-beta.1

2 years ago

0.4.3-beta.0

2 years ago

0.4.5

2 years ago

0.5.3

2 years ago

0.4.4

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.5.2

2 years ago

0.4.3

2 years ago

0.5.1

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.2-beta.2

2 years ago

0.3.2-beta.1

2 years ago

0.3.2-beta.0

2 years ago

0.3.1

2 years ago