-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add screen tracking plugin and add support for browser plugins
- Loading branch information
1 parent
0a00be2
commit 7c1b20a
Showing
33 changed files
with
1,504 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ct-native-tracker/markdown/react-native-tracker.trackerconfiguration.plugins.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@snowplow/react-native-tracker](./react-native-tracker.md) > [TrackerConfiguration](./react-native-tracker.trackerconfiguration.md) > [plugins](./react-native-tracker.trackerconfiguration.plugins.md) | ||
|
||
## TrackerConfiguration.plugins property | ||
|
||
Inject plugins which will be evaluated for each event | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
plugins?: BrowserPlugin[]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...nges/@snowplow/browser-plugin-screen-tracking/issue-screen-tracking_2024-11-26-13-58.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@snowplow/browser-plugin-screen-tracking", | ||
"comment": "Add screen tracking plugin and add support for browser plugins (#1394)", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@snowplow/browser-plugin-screen-tracking" | ||
} |
10 changes: 10 additions & 0 deletions
10
common/changes/@snowplow/react-native-tracker/issue-screen-tracking_2024-11-26-13-58.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@snowplow/react-native-tracker", | ||
"comment": "Add screen tracking plugin and add support for browser plugins (#1394)", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@snowplow/react-native-tracker" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. | ||
{ | ||
"pnpmShrinkwrapHash": "f5c19c955ef1b13843dbacdb20bdd6461a9a5042", | ||
"pnpmShrinkwrapHash": "689314deaba527b91de0bf37e78f6564cb669a44", | ||
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@snowplow/browser-plugin-screen-tracking", | ||
"entries": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Change Log - @snowplow/browser-plugin-snowplow-screen-tracking | ||
|
||
This log was last generated on Fri, 01 Nov 2024 10:35:07 GMT and should not be manually modified. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Snowplow Screen Tracking Plugin | ||
|
||
[![npm version][npm-image]][npm-url] | ||
[![License][license-image]](LICENSE) | ||
|
||
Browser Plugin to be used with `@snowplow/browser-tracker`. The plugin is already included in `@snowplow/react-native-tracker`. | ||
|
||
This plugin is the recommended way to track screen view events. | ||
|
||
## Maintainer quick start | ||
|
||
Part of the Snowplow JavaScript Tracker monorepo. | ||
Build with [Node.js](https://nodejs.org/en/) (18 - 20) and [Rush](https://rushjs.io/). | ||
|
||
### Setup repository | ||
|
||
```bash | ||
npm install -g @microsoft/rush | ||
git clone https://github.com/snowplow/snowplow-javascript-tracker.git | ||
rush update | ||
``` | ||
|
||
## Package Installation | ||
|
||
With npm: | ||
|
||
```bash | ||
npm install @snowplow/browser-plugin-snowplow-screen-tracking | ||
``` | ||
|
||
## Usage | ||
|
||
Initialize your tracker with the ScreenTrackingPlugin: | ||
|
||
```js | ||
import { newTracker } from '@snowplow/browser-tracker'; | ||
import { ScreenTrackingPlugin } from '@snowplow/browser-plugin-screen-tracking'; | ||
|
||
newTracker('sp1', '{{collector_url}}', { | ||
appId: 'my-app-id', | ||
plugins: [ ScreenTrackingPlugin() ], | ||
}); | ||
``` | ||
|
||
For a full API reference, you can read the plugin [documentation page](https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/browser-tracker/browser-tracker-v3-reference/plugins/screen-tracking/). | ||
|
||
## Copyright and license | ||
|
||
Licensed and distributed under the [BSD 3-Clause License](LICENSE) ([An OSI Approved License][osi]). | ||
|
||
Copyright (c) 2022 Snowplow Analytics Ltd. | ||
|
||
All rights reserved. | ||
|
||
[npm-url]: https://www.npmjs.com/package/@snowplow/browser-plugin-screen-tracking | ||
[npm-image]: https://img.shields.io/npm/v/@snowplow/browser-plugin-screen-tracking | ||
[docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-tracker/ | ||
[osi]: https://opensource.org/licenses/BSD-3-Clause | ||
[license-image]: https://img.shields.io/npm/l/@snowplow/browser-plugin-screen-tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
reporters: ['jest-standard-reporter'], | ||
setupFilesAfterEnv: ['../../setupTestGlobals.ts'], | ||
testEnvironment: 'jest-environment-jsdom-global', | ||
}; |
Oops, something went wrong.