Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript trackers 4.2 with the React Native tracker #1113

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

matus-tomlein
Copy link
Contributor

This PR adds:

  • docs for the new React Native tracker version 4.2 that now builds on top of the JS trackers
  • migration guide from RN tracker 2 to 4
  • docs for the new screen view tracking browser plugin for the Web trackers

Copy link

netlify bot commented Jan 3, 2025

Deploy Preview for snowplow-docs ready!

Name Link
🔨 Latest commit d89e08e
🔍 Latest deploy log https://app.netlify.com/sites/snowplow-docs/deploys/6777d4253fd33e00088f6067
😎 Deploy Preview https://deploy-preview-1113--snowplow-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -47,6 +47,7 @@ If you are using the JavaScript tracker with the full `sp.js` and your plugin is
| Site* | Events | Manual | ✅ | ❌ | `browser-plugin-site-tracking` |
| [Timezone](/docs/sources/trackers/javascript-trackers/web-tracker/tracking-events/timezone-geolocation/index.md) | Other | Automatic | ❌ | ❌ | `browser-plugin-timezone` |
| [Web vitals](/docs/sources/trackers/javascript-trackers/web-tracker/tracking-events/web-vitals/index.md) | Events | Automatic | ✅ | ❌ | `browser-plugin-web-vitals` |
| [Screen views](/docs/sources/trackers/javascript-trackers/web-tracker/tracking-events/screen-views/index.md) | Events | Combination | ❌ | ❌ | `browser-plugin-screen-tracking` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be in alphabetical order please

```javascript
window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-button-click-tracking@latest/dist/index.umd.min.js',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-button-click-tracking@latest/dist/index.umd.min.js',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-screen-tracking@latest/dist/index.umd.min.js',

window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-button-click-tracking@latest/dist/index.umd.min.js',
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin']
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin'],

I think?


If the `screenContext` property is enabled, the tracker attaches a [`Screen` entity](http://iglucentral.com/schemas/com.snowplowanalytics.mobile/screen/jsonschema/1-0-0) to all the events tracked by the tracker reporting the last (and probably current) screen visible on device when the event was tracked.

The `Screen` entity is conditioned by the internal state of the tracker only. To make an example, if the developer manually tracks a `ScreenView` event, all the following events will have a `Screen` entity attached reporting the same information as the last tracked ScreenView event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `Screen` entity is conditioned by the internal state of the tracker only. To make an example, if the developer manually tracks a `ScreenView` event, all the following events will have a `Screen` entity attached reporting the same information as the last tracked ScreenView event.
The `Screen` entity is based off the internal state of the tracker only. To make an example, if the developer manually tracks a `ScreenView` event, all the following events will have a `Screen` entity attached reporting the same information as the last tracked ScreenView event.

window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-button-click-tracking@latest/dist/index.umd.min.js',
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin']
['snowplowScreenTrackingPlugin', 'ScreenTrackingPlugin'],

@@ -1,9 +1,11 @@
---
title: "Previous versions"
date: "2021-08-09"
sidebar_position: 50
sidebar_custom_props:
outdated: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please can you put the migration guides in their own section, and then put this back here

@@ -42,8 +34,7 @@ The automatically captured data are:
* [**Platform and Application Context Tracking**](./platform-and-application-context/index.md): Captures contextual information about the device and the app.
* [**Session Tracking**](./session-tracking/index.md): Captures the session which helps to keep track of the user activity in the app.
* [**App Lifecycle Tracking**](./lifecycle-tracking/index.md): Captures application lifecycle state changes (foreground/background transitions).
* [**Screen View Tracking**](./screen-tracking/index.md): Captures each time a new “screen” is loaded.
* [**Exception Tracking**](./exception-tracking/index.md): Captures any unhandled exceptions within the application.
* [**Screen View and Engagement Tracking**](./screen-tracking/index.md): Captures each time a new “screen” is loaded.
* [**Installation Tracking**](./installation-tracking/index.md): Captures an install event which occurs the first time an application is opened.

## Manually-tracked events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move Structured events down the page?

@@ -17,15 +17,9 @@ If installation autotracking is not enabled, the tracker will still keep track o
The installation autotracking is enabled by default. It can be set in `TrackerConfiguration` like in the example below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled or disabled?

@@ -12,20 +12,14 @@ import TabItem from '@theme/TabItem';

The tracker can capture application lifecycle state changes. In particular, when the app changes state from foreground to background and vice versa.

The lifecycle tracking is disabled by default. It can be enabled in `TrackerConfiguration` like in the example below:
The lifecycle tracking is disabled by default. It can be enabled using the `lifecycleAutotracking` option like in the example below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled or enabled?

### Initialize tracker instance using `newTracker` instead of `createTracker`

The method for creating a new tracker instance has been changed to `newTracker`.
This is not just a rename, but a change in the structure of it's parameters, which are now more in line with the rest of our JavaScript trackers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is not just a rename, but a change in the structure of it's parameters, which are now more in line with the rest of our JavaScript trackers.
This is not just a rename, but a change in the structure of its parameters, which are now more in line with the rest of our JavaScript trackers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants