From e9fb6569815e807e113ba1bd8b2ec86dce845d07 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 16 Jul 2024 13:26:30 +0100 Subject: [PATCH] Prepare for MDX v3 migration (#958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prepare for MDX3 migration * Fix TabItem after list * Fix all “Unsupported Expression” errors * Fix markdown inside mdx expressions --- .../marketo/index.md | 4 +- .../zendesk/index.md | 2 +- .../google-analytics-plugin/index.md | 16 +-- .../getting-cookie-values/index.md | 13 +- .../cookies-and-local-storage/index.md | 6 +- .../using-an-id-service/index.md | 7 +- .../plugins/enhanced-consent/index.md | 11 +- .../plugins/geolocation/index.md | 13 +- .../plugins/snowplow-ecommerce/index.md | 23 ++-- .../tracking-events/index.md | 130 +++++++++--------- .../using-an-id-service/index.md | 7 +- .../plugins/enhanced-consent/index.md | 7 +- .../plugins/snowplow-ecommerce/index.md | 19 +-- .../tracking-events/index.md | 110 +++++++-------- .../web-tracker/quick-start-guide/index.md | 16 +-- .../tracking-events/button-click/index.md | 23 +--- .../tracking-events/campaigns-utms/index.md | 2 +- .../ecommerce/enhanced/index.md | 7 +- .../ecommerce/original/index.md | 7 +- .../tracking-events/focalmeter/index.md | 8 +- .../tracking-events/form-tracking/index.md | 9 +- .../tracking-events/ga-cookies/index.md | 3 +- .../web-tracker/tracking-events/index.md | 7 +- .../tracking-events/link-click/index.md | 9 +- .../tracking-events/media/youtube/index.md | 3 +- .../tracking-events/optimizely/index.md | 31 ++--- .../tracking-events/page-views/index.md | 7 +- .../android-0-1-0-java-0-5-0/index.md | 6 +- .../android-tracker/android-0-3-0/index.md | 4 +- .../android-tracker/android-0-4-0/index.md | 4 +- .../android-tracker/android-0-5-0/index.md | 4 +- .../android-tracker/android-0-6-0/index.md | 4 +- .../android-tracker/android-0-7-0/index.md | 4 +- .../ecommerce-tracking/index.md | 91 ++++++------ .../tracking-events/visionos/index.md | 9 +- .../tracking-specific-events/index.md | 4 +- .../python-tracker/setup/index.md | 1 + .../configuring-collector/ui/index.md | 2 +- docs/first-steps/tracking/index.md | 3 +- .../quick-start/index.md | 8 +- .../what-is-deployed/index.md | 15 +- .../dbt-configuration/index.md | 6 +- .../using-different-sessionisation/index.md | 6 +- .../dbt-attribution-data-model/index.md | 6 +- .../dbt-ecommerce-data-model/index.md | 1 + .../dbt-media-player-data-model/index.md | 1 + .../dbt-normalize-data-model/index.md | 4 +- .../app-errors-module/index.md | 1 + .../consent-module/index.md | 1 + .../conversions/index.md | 46 +++---- .../core-web-vitals-module/index.md | 3 +- .../dbt-models/dbt-utils-data-model/index.md | 1 + .../legacy/dbt-mobile-data-model/index.md | 1 + .../consent-module/index.md | 5 +- .../core-web-vitals-module/index.md | 1 + .../full-or-partial-refreshes/index.md | 10 +- .../migration-guides/web_to_unified/index.md | 44 +++--- .../index.md | 10 +- .../configuration-reference/_delta_config.md | 20 +-- .../configuration-reference/_hudi_config.md | 13 +- .../configuration-reference/index.md | 2 +- .../index.md | 2 +- .../rdb-loader-3-0-x/index.md | 2 +- .../rdb-loader-4-0-x/index.md | 2 +- .../configuration-reference/index.md | 4 +- .../reusable/batch-only/_index.mdx | 4 +- .../stream-collector/setup/index.md | 1 + .../data-modeling/core-web-vitals/_index.md | 3 +- .../javascript-tracker-cross-domain/_index.md | 100 ++++++-------- .../_browser.md | 11 ++ .../{_index.md => _javascript.md} | 21 --- docs/reusable/schema-properties/_index.md | 5 +- docs/reusable/telemetry/_index.md | 3 +- 73 files changed, 493 insertions(+), 506 deletions(-) create mode 100644 docs/reusable/javascript-tracker-retrieve-values/_browser.md rename docs/reusable/javascript-tracker-retrieve-values/{_index.md => _javascript.md} (75%) diff --git a/docs/collecting-data/collecting-data-from-third-parties/marketo/index.md b/docs/collecting-data/collecting-data-from-third-parties/marketo/index.md index caf6eda888..d48281dfb6 100644 --- a/docs/collecting-data/collecting-data-from-third-parties/marketo/index.md +++ b/docs/collecting-data/collecting-data-from-third-parties/marketo/index.md @@ -36,14 +36,14 @@ Set the ‘Request Token Encoding’ to JSON and the ‘Request Type’ to POST. http://collector.domain.com/com.marketo/v1?aid= ``` -To further distinguish the webhooks 3 additional fields are included: “name”, “description” and “step”. In order to populate these fields custom tokens must be created for each webhook. Custom tokens (begins with ‘{{my.’ followed by the name you created for the token) can be created in either campaign folders or programs. For our custom “step” field please create the custom token as a “number” type. +To further distinguish the webhooks 3 additional fields are included: “name”, “description” and “step”. In order to populate these fields custom tokens must be created for each webhook. Custom tokens (begins with `{{my.` followed by the name you created for the token) can be created in either campaign folders or programs. For our custom “step” field please create the custom token as a “number” type. In the below example the webhook is called at the 3rd step in Campaign A’s flow. **_NOTE:_ change the token names for the first 3 fields to align with the event your own webhook is activated on.** ```json -{ +{ "name": {{my.Campaign A}}, "description": {{my.Campaign A desc}}, "step": {{my.Campaign A step}}, diff --git a/docs/collecting-data/collecting-data-from-third-parties/zendesk/index.md b/docs/collecting-data/collecting-data-from-third-parties/zendesk/index.md index 3b4aa9ecf4..b98b9b7488 100644 --- a/docs/collecting-data/collecting-data-from-third-parties/zendesk/index.md +++ b/docs/collecting-data/collecting-data-from-third-parties/zendesk/index.md @@ -24,7 +24,7 @@ Choose "HTTP target" from the list of target types to add: Name the new extension something like "Snowplow Collector - Iglu POST". The "Iglu POST" here represents the fact we will be sending Zendesk events and contexts to [Iglu webhook adapter](/docs/collecting-data/collecting-data-from-third-parties/iglu-webhook/index.md) via `POST` request. -In the **URL** field, enter "https://{{collctor_domain}}/com.snowplowanalytics.iglu/v1?aid=zendesk", replacing `{{collctor_domain}}` with your collector domain. +In the **URL** field, enter `https://{{collector_domain}}/com.snowplowanalytics.iglu/v1?aid=zendesk`, replacing `{{collector_domain}}` with your collector domain. You can optionally have `?aid={{my_zendesk_namespace}}` added to this URL, where `{{my_zendesk_namespace}}` is a label for the application (here: "zendesk"). This label will be attached to all events fired by the extension, so you can later check where a given event came from (useful if you have more than one Zendesk account). diff --git a/docs/collecting-data/collecting-from-own-applications/google-analytics-plugin/index.md b/docs/collecting-data/collecting-from-own-applications/google-analytics-plugin/index.md index d4f341ee31..05020b5450 100644 --- a/docs/collecting-data/collecting-from-own-applications/google-analytics-plugin/index.md +++ b/docs/collecting-data/collecting-from-own-applications/google-analytics-plugin/index.md @@ -30,22 +30,22 @@ The best way to deploy this using Google Tag Manager is to replicate the plugin ### 1. Create a new Custom JavaScript variable -Create a new Custom JavaScript variable, and name it {{customTask - Snowplow duplicator}}. Add the following code within: +Create a new Custom JavaScript variable, and name it `{{customTask - Snowplow duplicator}}`. Add the following code within: ```javascript function() { // Add your snowplow collector endpoint here var endpoint = 'https://mycollector.mydomain.com/'; - + return function(model) { var vendor = 'com.google.analytics'; var version = 'v1'; var path = ((endpoint.substr(-1) !== '/') ? endpoint + '/' : endpoint) + vendor + '/' + version; - + var globalSendTaskName = '_' + model.get('trackingId') + '_sendHitTask'; - + var originalSendHitTask = window[globalSendTaskName] = window[globalSendTaskName] || model.get('sendHitTask'); - + model.set('sendHitTask', function(sendModel) { var payload = sendModel.get('hitPayload'); originalSendHitTask(sendModel); @@ -60,7 +60,7 @@ function() { This stores a reference to the original `sendHitTask` in a globally scoped variable (e.g. `window['_UA-12345-1_sendHitTask']`) to avoid multiple runs of this `customTask` from cascading on each other. -### 2. Add {{customTask - Snowplow duplicator}} to Google Analytics tags +### 2. Add `{{customTask - Snowplow duplicator}}` to Google Analytics tags This variable must be added to every single Google Analytics tag in the GTM container, whose hits you want to duplicate to Snowplow. @@ -71,7 +71,7 @@ Regardless of whether you choose to add this variable directly to the tags' sett 1. Browse to the tags' **More Settings** option, expand it, and then expand **Fields to set**. If you are editing the tag directly (i.e. not using a Google Analytics Settings variable), you will need to check "Enable overriding settings in this tag" first. 2. Add a new field with: - **Field name**: customTask - - **Value**: {{customTask - Snowplow duplicator}} + - **Value**: `{{customTask - Snowplow duplicator}}` All tags which have this field set will now send the Google Analytics payload to the Snowplow endpoint. @@ -82,7 +82,7 @@ Further reading on the topic: ## Data structure -You can find the specific schema for the properties that will be collected via Google Analytics in the IgluCentral repository: +You can find the specific schema for the properties that will be collected via Google Analytics in the IgluCentral repository: [Google](https://github.com/snowplow/iglu-central/tree/master/schemas/com.google.analytics) [Google Measurement Protocol](https://github.com/snowplow/iglu-central/tree/master/schemas/com.google.analytics.measurement-protocol) diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/index.md index 743070e754..0987143d35 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/index.md @@ -27,9 +27,9 @@ function getSnowplowDuid(cookieName) { var match = document.cookie.match(matcher); var split = match[1].split('.'); if (match && match[1]) { - return { - 'domain_userid': split[0], - 'domain_sessionidx': split[2], + return { + 'domain_userid': split[0], + 'domain_sessionidx': split[2], 'domain_sessionid': split[5] } } else { @@ -46,18 +46,19 @@ If you set a custom `cookieName` field in the argmap, pass that name into the It's possible to retrieve cookie properties for use in your code (as well as the [page view UUID](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/index.md) and [user ID](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/#getting-user-id-once-set)) using a tracker callback. This is an advanced usage of the tracker. ```mdx-code-block -import RetrieveValues from "@site/docs/reusable/javascript-tracker-retrieve-values/_index.md" +import RetrieveValuesJs from "@site/docs/reusable/javascript-tracker-retrieve-values/_javascript.md" +import RetrieveValuesBrowser from "@site/docs/reusable/javascript-tracker-retrieve-values/_browser.md" ``` - + - + diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/index.md index a9f7ad25cc..cc2c2b3556 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/index.md @@ -44,7 +44,7 @@ If no session cookie is already present when an event fires, the tracker treats Note: A new session can be started at any time by calling the function `newSession`. -When using [anonymous tracking](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/anonymous-tracking/index.md) with session (`anonymousTracking: { withSessionTracking: true }`; available from v2.15.0+) this key will contain a _salt_ value which is used to stitch page views into a session. The value is never sent to the collector. +When using [anonymous tracking](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/anonymous-tracking/index.md) with session (`anonymousTracking: { withSessionTracking: true }`; available from v2.15.0+) this key will contain a _salt_ value which is used to stitch page views into a session. The value is never sent to the collector. ### Collector cookie `sp` @@ -64,8 +64,8 @@ Local storage will only be used if `stateStorageStrategy` is set to `localSto | Storage key | Description | |--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| snowplowOutQueue_{namespace}_post2 | Used to store a cache of unsent events. This is used to reduce the chance of events to be lost due to page navigation and events not being set to the collector before the navigation event occurs. Where GET requests are used, this key will end in `_get` rather than `_post2`. | -| snowplowOutQueue_{namespace}_post2.expires | Used to match the concept of cookie expiry within local storage. This ensures a consistent behavior between cookie and local storage. Where GET requests are used, this key will end in `_get` rather than `_post2`. | +| `snowplowOutQueue_{namespace}_post2` | Used to store a cache of unsent events. This is used to reduce the chance of events to be lost due to page navigation and events not being set to the collector before the navigation event occurs. Where GET requests are used, this key will end in `_get` rather than `_post2`. | +| `snowplowOutQueue_{namespace}_post2.expires` | Used to match the concept of cookie expiry within local storage. This ensures a consistent behavior between cookie and local storage. Where GET requests are used, this key will end in `_get` rather than `_post2`. | ## Mapping values to tracker protocol diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/advanced-usage/using-an-id-service/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/advanced-usage/using-an-id-service/index.md index f02d0abe1e..a53fffbdd4 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/advanced-usage/using-an-id-service/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/advanced-usage/using-an-id-service/index.md @@ -6,7 +6,8 @@ sidebar_position: 3000 ```mdx-code-block import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -44,7 +45,7 @@ The responsibilities of this service are: _The new unique identifier cookie for sake of simplicity in this document will have the name `spIdService`._ -### ID service business logic +### ID service business logic The ID service code should include the following logic: @@ -53,7 +54,7 @@ The ID service code should include the following logic: - If `spIdService` and `sp` are both missing, then it generates a new ID in the `spIdService` and `sp` cookies with the same unique identifier generation algorithm with the Snowplow pipeline, currently UUID v4. - The HTTP response should have a 200 OK status code but any additional payload is not necessary. -### Code examples +### Code examples Below we showcase a couple of code samples for ID service API endpoints: diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/enhanced-consent/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/enhanced-consent/index.md index 9994a02b91..30a7448fae 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/enhanced-consent/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/enhanced-consent/index.md @@ -4,7 +4,8 @@ sidebar_position: 6500 --- ```mdx-code-block -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -26,8 +27,8 @@ The plugin is available since version 3.8 of the tracker. import { newTracker } from '@snowplow/browser-tracker'; import { EnhancedConsentPlugin } from '@snowplow/browser-plugin-enhanced-consent'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ EnhancedConsentPlugin() ], }); ``` @@ -35,7 +36,7 @@ newTracker('sp1', '{{collector_url}}', { ## Functions API | Used for: --- | -- +-- | -- `trackConsentAllow` | Track an acceptance of user consent. `trackConsentSelected` | Track a specific selection of consented scopes. `trackConsentPending` | Track the unconfirmed selection about user consent. @@ -43,7 +44,7 @@ API | Used for: `trackConsentDeny` | Track a denial of user consent. `trackConsentExpired` | Track the expiration of a consent selection. `trackConsentWithdrawn` | Track the withdrawal of user consent. -`trackCmpVisible` | Track the render time of a CMP banner. +`trackCmpVisible` | Track the render time of a CMP banner. ## Usage diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/geolocation/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/geolocation/index.md index 27bb6294e1..4b53a289cd 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/geolocation/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/geolocation/index.md @@ -15,8 +15,8 @@ If this plugin is enabled, the tracker will attempt to create a context from the ## Installation - `npm install @snowplow/browser-plugin-geolocation` -- ``yarn add @snowplow/browser-plugin-`geolocation` `` -- ``pnpm add @snowplow/browser-plugin-`geolocation` `` +- `yarn add @snowplow/browser-plugin-geolocation` +- `pnpm add @snowplow/browser-plugin-geolocation` ## Initialization @@ -34,11 +34,16 @@ enableGeolocationContext(); ### Functions - + +
enableGeolocationContext + + + +
enableGeolocationContext [Documentation](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/tracker-setup/initialization-options/index.md) -
+
### Context diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/snowplow-ecommerce/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/snowplow-ecommerce/index.md index 1ee6263014..7307ef949c 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/snowplow-ecommerce/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/plugins/snowplow-ecommerce/index.md @@ -4,7 +4,8 @@ sidebar_position: 16000 --- ```mdx-code-block -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -26,8 +27,8 @@ The plugin is available since version 3.8 of the tracker. import { newTracker } from '@snowplow/browser-tracker'; import { SnowplowEcommercePlugin } from '@snowplow/browser-plugin-snowplow-ecommerce'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ SnowplowEcommercePlugin() ], }); ``` @@ -35,8 +36,8 @@ newTracker('sp1', '{{collector_url}}', { ## Functions API | Used for: --- | -- -`trackProductView` | Tracking a visit to a product page. Known also as product detail view. +-- | -- +`trackProductView` | Tracking a visit to a product page. Known also as product detail view. `trackAddToCart` | Track an addition to cart. `trackRemoveFromCart` | Track a removal from cart. `trackProductListView` | Track an impression of a product list. The list could be a search results page, recommended products, upsells etc. @@ -198,7 +199,7 @@ trackProductListClick({ import { trackPromotionView } from '@snowplow/browser-plugin-snowplow-ecommerce'; /* Carousel slide 1 viewed */ -trackPromotionView({ +trackPromotionView({ id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -207,7 +208,7 @@ trackPromotionView({ }); /* On carousel slide 2 view */ -trackPromotionView({ +trackPromotionView({ id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -221,7 +222,7 @@ trackPromotionView({ ```js import { trackPromotionClick } from "@snowplow/browser-plugin-snowplow-ecommerce"; -trackPromotionClick({ +trackPromotionClick({ id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -521,7 +522,7 @@ Available from version 3.10. If you already use Google Analytics 4 ecommerce or Universal Analytics Enhanced Ecommerce to collect information about the shopping behavior of your users, we have prepared a way to quickly implement Snowplow Ecommerce without making many changes on your current setup. -The _transitional_ API that we provide, depends on the standardized [dataLayer](https://developers.google.com/tag-platform/tag-manager/web/datalayer) structure for both Google Analytics ecommerce implementations. This would make it easier for the transition to happen either through Google Tag Manager, which has more control over the dataLayer, or custom code that uses the standard ecommerce structures. +The _transitional_ API that we provide, depends on the standardized [dataLayer](https://developers.google.com/tag-platform/tag-manager/web/datalayer) structure for both Google Analytics ecommerce implementations. This would make it easier for the transition to happen either through Google Tag Manager, which has more control over the dataLayer, or custom code that uses the standard ecommerce structures. :::info To learn more about how to use this transitional API, you should go ahead and visit our [Ecommerce Web Accelerator](https://docs.snowplow.io/accelerators/ecommerce/tracking/ua_ga4_migration/) dedicated page which describes the usage of these methods and more. @@ -641,7 +642,7 @@ trackEnhancedEcommercePurchase( {{dataLayer.ecommerce reference}}, { }); ``` -- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. +- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. ### Google Analytics 4 Ecommerce @@ -785,4 +786,4 @@ trackGA4Transaction({ }); ``` -- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. +- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/tracking-events/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/tracking-events/index.md index 08df9da6da..01390ac995 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/tracking-events/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/browser-tracker-v3-reference/tracking-events/index.md @@ -39,10 +39,10 @@ This page goes on to discuss more advanced topics in tracking events: Page views are tracked using the `trackPageView` method. This is generally part of the first Snowplow tag to fire on a particular web page. As a result, the `trackPageView` method is usually deployed straight after the tag that also invokes the Snowplow JavaScript (sp.js) e.g. ```javascript -import { - newTracker, - enableActivityTracking, - trackPageView +import { + newTracker, + enableActivityTracking, + trackPageView } from '@snowplow/browser-tracker'; newTracker('sp', '{{collector_url_here}}', { @@ -84,9 +84,9 @@ Additionally, you can pass a function which returns an array of zero or more con For example: ```javascript -import { - enableActivityTracking, - trackPageView +import { + enableActivityTracking, + trackPageView } from '@snowplow/browser-tracker'; // Turn on page pings every 10 seconds @@ -129,27 +129,27 @@ That is accomplished using 'page ping' events. If activity tracking is enabled, Page pings are enabled by: ```javascript -import { +import { enableActivityTracking } from '@snowplow/browser-tracker'; -enableActivityTracking({ - minimumVisitLength: number, - heartbeatDelay: number +enableActivityTracking({ + minimumVisitLength: number, + heartbeatDelay: number }); ``` where `minimumVisitLength` is the time period from page load before the first page ping occurs, in seconds. `heartbeat` is the number of seconds between each page ping, once they have started. So, if you executed: ```javascript -import { - enableActivityTracking, - trackPageView +import { + enableActivityTracking, + trackPageView } from '@snowplow/browser-tracker'; -enableActivityTracking({ - minimumVisitLength: 30, - heartbeatDelay: 10 +enableActivityTracking({ + minimumVisitLength: 30, + heartbeatDelay: 10 }); trackPageView(); @@ -168,13 +168,13 @@ Notes: You can now perform edge analytics in the browser to reduce the number of events sent to you collector whilst still tracking user activity. The Snowplow JavaScript Tracker enabled this by allowing a callback to be specified in place of a page ping being sent. This is enabled by: ```javascript -import { +import { enableActivityTrackingCallback } from '@snowplow/browser-tracker'; -enableActivityTrackingCallback({ - minimumVisitLength: number, - heartbeatDelay: number, +enableActivityTrackingCallback({ + minimumVisitLength: number, + heartbeatDelay: number, callback: (data: ActivityCallbackData) => void }); ``` @@ -204,9 +204,9 @@ type ActivityCallbackData = { A full example of how this might be used to aggregate page ping information and then send an event on page unload is below: ```javascript -import { - newTracker, - enableActivityTrackingCallback, +import { + newTracker, + enableActivityTrackingCallback, trackPageView, trackSelfDescribingEvent } from '@snowplow/browser-tracker'; @@ -223,9 +223,9 @@ var aggregatedEvent = { maxYOffset: 0, numEvents: 0 }; -enableActivityTrackingCallback({ - minimumVisitLength: 10, - heartbeatDelay: 10, +enableActivityTrackingCallback({ + minimumVisitLength: 10, + heartbeatDelay: 10, callback: function (event) { aggregatedEvent = { pageViewId: event.pageViewId, @@ -383,9 +383,9 @@ An example of tracking a user listening to a music mix: import { trackStructEvent } from '@snowplow/browser-tracker'; trackStructEvent({ - category: 'Mixes', - action: 'Play', - label: 'MrC/fabric-0503-mix', + category: 'Mixes', + action: 'Play', + label: 'MrC/fabric-0503-mix', value: 0.0 }); ``` @@ -715,9 +715,9 @@ This is its signature: ```javascript import { enableLinkClickTracking } from '@snowplow/browser-plugin-link-click-tracking'; -enableLinkClickTracking({ - options?: FilterCriterion, - pseudoClicks?: boolean, +enableLinkClickTracking({ + options?: FilterCriterion, + pseudoClicks?: boolean, trackContent?: boolean context?: SelfDescribingJson[] }); @@ -753,7 +753,7 @@ This is an array of CSS classes which should be ignored by link click tracking. ```javascript import { enableLinkClickTracking } from '@snowplow/browser-plugin-link-click-tracking'; -enableLinkClickTracking({ +enableLinkClickTracking({ options: { denylist: ['barred', 'untracked'] } @@ -775,8 +775,8 @@ The opposite of a denylist. This is an array of the CSS classes of links which y ```javascript import { enableLinkClickTracking } from '@snowplow/browser-plugin-link-click-tracking'; -enableLinkClickTracking({ - options: { +enableLinkClickTracking({ + options: { 'allowlist': ['unbarred', 'tracked'] } }); @@ -876,10 +876,10 @@ Of these arguments, only `targetUrl` is required. This is how to use `trackLi import { trackLinkClick } from '@snowplow/browser-plugin-link-click-tracking'; trackLinkClick({ - targetUrl: 'http://www.example.com', - elementId: 'first-link', - elementClasses: ['class-1', 'class-2'], - elementTarget: '', + targetUrl: 'http://www.example.com', + elementId: 'first-link', + elementClasses: ['class-1', 'class-2'], + elementTarget: '', elementContent: 'this page' }); ``` @@ -1112,7 +1112,7 @@ import { addTrans } from '@snowplow/browser-plugin-ecommerce' addTrans({ orderId: '1234', // required total: 11.99, // required - affiliation: 'Acme Clothing', + affiliation: 'Acme Clothing', tax: 1.29, shipping: 5, city: 'San Jose', @@ -1148,7 +1148,7 @@ import { addItem } from '@snowplow/browser-plugin-ecommerce' addItem({ orderId: '1234', // required sku: 'DD44', // required - name: 'T-Shirt', + name: 'T-Shirt', category: 'Green Medium', price: 11.99, quantity: 1, @@ -1187,20 +1187,20 @@ An example: import { trackAddToCart, trackRemoveFromCart } from '@snowplow/browser-plugin-ecommerce'; trackAddToCart({ - sku: '000345', - name: 'blue tie', - category: 'clothing', - unitPrice: 3.49, - quantity: 2, + sku: '000345', + name: 'blue tie', + category: 'clothing', + unitPrice: 3.49, + quantity: 2, currency: 'GBP' }); trackRemoveFromCart({ - sku: '000345', - name: 'blue tie', - category: 'clothing', - unitPrice: 3.49, - quantity: 2, + sku: '000345', + name: 'blue tie', + category: 'clothing', + unitPrice: 3.49, + quantity: 2, currency: 'GBP' }); ``` @@ -1240,10 +1240,10 @@ The method is executed in as: ```javascript import { trackSocialInteraction } from '@snowplow/browser-plugin-site-tracking'; -trackSocialInteraction({ - action: string, - network: string, - target: string +trackSocialInteraction({ + action: string, + network: string, + target: string }); ``` @@ -1253,8 +1253,8 @@ For example: import { trackSocialInteraction } from '@snowplow/browser-plugin-site-tracking'; trackSocialInteraction({ - action: 'like', - network: 'facebook', + action: 'like', + network: 'facebook', target: 'pbz00123' }); ``` @@ -1344,7 +1344,7 @@ We want to be able to identify people who've clicked on ads e.g. in a marketing Visit website ``` -For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at .) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. +For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at `http://mysite.com/myproduct.html`.) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. #### Anatomy of the query parameters @@ -1794,10 +1794,10 @@ As an example, `trackConsentGranted` will store one consent document as a cust ```javascript trackConsentGranted({ - id: '1234', - version: '5', - name: 'consent_document', - description: 'a document granting consent', + id: '1234', + version: '5', + name: 'consent_document', + description: 'a document granting consent', expiry: '2020-11-21T08:00:00.000Z' }); ``` @@ -1922,8 +1922,8 @@ try { var user = getUser() } catch(e) { trackError({ - message: 'Cannot get user object', - filename: 'shop.js', + message: 'Cannot get user object', + filename: 'shop.js', error: e }); } diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/advanced-usage/using-an-id-service/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/advanced-usage/using-an-id-service/index.md index 764b6c915e..7a894aa096 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/advanced-usage/using-an-id-service/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/advanced-usage/using-an-id-service/index.md @@ -6,7 +6,8 @@ sidebar_position: 3000 ```mdx-code-block import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -44,7 +45,7 @@ The responsibilities of this service are: _The new unique identifier cookie for sake of simplicity in this document will have the name `spIdService`._ -### ID service business logic +### ID service business logic The ID service code should include the following logic: @@ -53,7 +54,7 @@ The ID service code should include the following logic: - If `spIdService` and `sp` are both missing, then it generates a new ID in the `spIdService` and `sp` cookies with the same unique identifier generation algorithm with the Snowplow pipeline, currently UUID v4. - The HTTP response should have a 200 OK status code but any additional payload is not necessary. -### Code examples +### Code examples Below we showcase a couple of code samples for ID service API endpoints: diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/enhanced-consent/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/enhanced-consent/index.md index 26cef0224e..642e5c3e85 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/enhanced-consent/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/enhanced-consent/index.md @@ -4,7 +4,8 @@ sidebar_position: 6500 --- ```mdx-code-block -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -36,7 +37,7 @@ window.snowplow( ## Functions API | Used for: --- | -- +-- | -- `trackConsentAllow` | Track an acceptance of user consent. `trackConsentSelected` | Track a specific selection of consented scopes. `trackConsentPending` | Track the unconfirmed selection about user consent. @@ -44,7 +45,7 @@ API | Used for: `trackConsentDeny` | Track a denial of user consent. `trackConsentExpired` | Track the expiration of a consent selection. `trackConsentWithdrawn` | Track the withdrawal of user consent. -`trackCmpVisible` | Track the render time of a CMP banner. +`trackCmpVisible` | Track the render time of a CMP banner. ## Usage diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/snowplow-ecommerce/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/snowplow-ecommerce/index.md index 1309e082ea..bf4a873b9b 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/snowplow-ecommerce/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/plugins/snowplow-ecommerce/index.md @@ -4,7 +4,8 @@ sidebar_position: 16500 --- ```mdx-code-block -import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md' +import ReleaseBadge from '@site/docs/reusable/javascript-tracker-release-badge-v3/_index.md'; + ``` @@ -36,8 +37,8 @@ window.snowplow( ## Functions API | Used for: --- | -- -`trackProductView` | Tracking a visit to a product page. Known also as product detail view. +-- | -- +`trackProductView` | Tracking a visit to a product page. Known also as product detail view. `trackAddToCart` | Track an addition to cart. `trackRemoveFromCart` | Track a removal from cart. `trackProductListView` | Track an impression of a product list. The list could be a search results page, recommended products, upsells etc. @@ -187,7 +188,7 @@ window.snowplow("trackProductListClick:{trackerName}", { ### trackPromotionView ```js /* Carousel slide 1 viewed */ -window.snowplow("trackPromotionView:{trackerName}", { +window.snowplow("trackPromotionView:{trackerName}", { id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -196,7 +197,7 @@ window.snowplow("trackPromotionView:{trackerName}", { }); /* On carousel slide 2 view */ -window.snowplow("trackPromotionView:{trackerName}", { +window.snowplow("trackPromotionView:{trackerName}", { id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -208,7 +209,7 @@ window.snowplow("trackPromotionView:{trackerName}", { ### trackPromotionClick ```js -window.snowplow("trackPromotionClick:{trackerName}", { +window.snowplow("trackPromotionClick:{trackerName}", { id: 'IP1234', name: 'promo_winter', type: 'carousel', @@ -496,7 +497,7 @@ Available from version 3.10. If you already use Google Analytics 4 ecommerce or Universal Analytics Enhanced Ecommerce to collect information about the shopping behavior of your users, we have prepared a way to quickly implement Snowplow Ecommerce without making many changes on your current setup. -The _transitional_ API that we provide, depends on the standardized [dataLayer](https://developers.google.com/tag-platform/tag-manager/web/datalayer) structure for both Google Analytics ecommerce implementations. This would make it easier for the transition to happen either through Google Tag Manager, which has more control over the dataLayer, or custom code that uses the standard ecommerce structures. +The _transitional_ API that we provide, depends on the standardized [dataLayer](https://developers.google.com/tag-platform/tag-manager/web/datalayer) structure for both Google Analytics ecommerce implementations. This would make it easier for the transition to happen either through Google Tag Manager, which has more control over the dataLayer, or custom code that uses the standard ecommerce structures. :::info To learn more about how to use this transitional API, you should go ahead and visit our [Ecommerce Web Accelerator](https://docs.snowplow.io/accelerators/ecommerce/tracking/ua_ga4_migration/) dedicated page which describes the usage of these methods and more. @@ -598,7 +599,7 @@ window.snowplow("trackEnhancedEcommercePurchase:{trackerName}", {{dataLayer.ecom }); ``` -- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. +- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. ### Google Analytics 4 Ecommerce @@ -722,4 +723,4 @@ window.snowplow("trackGA4Transaction:{trackerName}", { }); ``` -- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. +- Where `paymentMethod` is the payment method selected in this transaction. This attributes corresponds to the `payment_method` of the [transaction schema](https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0#L30). Defaults to `unknown`. diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/index.md index cd3209aa1a..c78ac558f0 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/index.md @@ -123,18 +123,18 @@ That is accomplished using 'page ping' events. If activity tracking is enabled, Page pings are enabled by: ```javascript -snowplow('enableActivityTracking', { - minimumVisitLength: number, - heartbeatDelay: number +snowplow('enableActivityTracking', { + minimumVisitLength: number, + heartbeatDelay: number }); ``` where `minimumVisitLength` is the time period from page load before the first page ping occurs, in seconds. `heartbeat` is the number of seconds between each page ping, once they have started. So, if you executed: ```javascript -snowplow('enableActivityTracking', { - minimumVisitLength: 30, - heartbeatDelay: 10 +snowplow('enableActivityTracking', { + minimumVisitLength: 30, + heartbeatDelay: 10 }); snowplow('trackPageView'); @@ -153,9 +153,9 @@ Notes: You can now perform edge analytics in the browser to reduce the number of events sent to you collector whilst still tracking user activity. The Snowplow JavaScript Tracker enabled this by allowing a callback to be specified in place of a page ping being sent. This is enabled by: ```javascript -snowplow('enableActivityTrackingCallback', { - minimumVisitLength: number, - heartbeatDelay: number, +snowplow('enableActivityTrackingCallback', { + minimumVisitLength: number, + heartbeatDelay: number, callback: (data: ActivityCallbackData) => void }); ``` @@ -197,9 +197,9 @@ var aggregatedEvent = { maxYOffset: 0, numEvents: 0 }; -snowplow('enableActivityTrackingCallback', { - minimumVisitLength: 10, - heartbeatDelay: 10, +snowplow('enableActivityTrackingCallback', { + minimumVisitLength: 10, + heartbeatDelay: 10, callback: function (event) { aggregatedEvent = { pageViewId: event.pageViewId, @@ -363,9 +363,9 @@ An example of tracking a user listening to a music mix: ```javascript runnable snowplow('trackStructEvent', { - category: 'Mixes', - action: 'Play', - label: 'MrC/fabric-0503-mix', + category: 'Mixes', + action: 'Play', + label: 'MrC/fabric-0503-mix', property: '', value: 0.0 }); @@ -678,9 +678,9 @@ snowplow('enableLinkClickTracking'); This is its signature (Where `?` defines an optional property): ```javascript -snowplow('enableLinkClickTracking', { - options?: FilterCriterion, - pseudoClicks?: boolean, +snowplow('enableLinkClickTracking', { + options?: FilterCriterion, + pseudoClicks?: boolean, trackContent?: boolean context?: SelfDescribingJson[] }); @@ -706,7 +706,7 @@ You can control which links are tracked using the second argument. There are thr This is an array of CSS classes which should be ignored by link click tracking. For example, the below code will stop link click events firing for links with the class "barred" or "untracked", but will fire link click events for all other links: ```javascript -snowplow('enableLinkClickTracking', { +snowplow('enableLinkClickTracking', { options: { denylist: ['barred', 'untracked'] } @@ -724,8 +724,8 @@ snowplow('enableLinkClickTracking', { options: { 'denylist': ['barred'] } }); The opposite of a denylist. This is an array of the CSS classes of links which you do want to be tracked. Only clicks on links with a class in the list will be tracked. ```javascript -snowplow('enableLinkClickTracking', { - options: { +snowplow('enableLinkClickTracking', { + options: { 'allowlist': ['unbarred', 'tracked'] } }); @@ -817,10 +817,10 @@ Of these arguments, only `targetUrl` is required. This is how to use `trackLi ```javascript snowplow('trackLinkClick', { - targetUrl: 'http://www.example.com', - elementId: 'first-link', - elementClasses: ['class-1', 'class-2'], - elementTarget: '', + targetUrl: 'http://www.example.com', + elementId: 'first-link', + elementClasses: ['class-1', 'class-2'], + elementTarget: '', elementContent: 'this page' }); ``` @@ -1021,7 +1021,7 @@ For example: snowplow('addTrans', { orderId: '1234', // required total: 11.99, // required - affiliation: 'Acme Clothing', + affiliation: 'Acme Clothing', tax: 1.29, shipping: 5, city: 'San Jose', @@ -1055,7 +1055,7 @@ For example: snowplow('addItem', { orderId: '1234', // required sku: 'DD44', // required - name: 'T-Shirt', + name: 'T-Shirt', category: 'Green Medium', price: 11.99, quantity: 1, @@ -1087,9 +1087,9 @@ snowplow('trackTrans'); n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","{{URL to sp.js}}","snowplow")); snowplow('newTracker', 'sp', '{{collector_url_here}}', { appId: 'my-store' }); - snowplow('enableActivityTracking',{ - minimumVisitLength: 30, - heartbeatDelay: 10 + snowplow('enableActivityTracking',{ + minimumVisitLength: 30, + heartbeatDelay: 10 }); snowplow('trackPageView'); snowplow('enableLinkClickTracking'); @@ -1097,7 +1097,7 @@ snowplow('trackTrans'); snowplow('addTrans', { orderId: '1234', // required total: 11.99, // required - affiliation: 'Acme Clothing', + affiliation: 'Acme Clothing', tax: 1.29, shipping: 5, city: 'San Jose', @@ -1112,7 +1112,7 @@ snowplow('trackTrans'); snowplow('addItem', { orderId: '1234', // required sku: 'DD44', // required - name: 'T-Shirt', + name: 'T-Shirt', category: 'Green Medium', price: 11.99, quantity: 1, @@ -1150,20 +1150,20 @@ An example: ```javascript snowplow('trackAddToCart', { - sku: '000345', - name: 'blue tie', - category: 'clothing', - unitPrice: 3.49, - quantity: 2, + sku: '000345', + name: 'blue tie', + category: 'clothing', + unitPrice: 3.49, + quantity: 2, currency: 'GBP' }); snowplow('trackRemoveFromCart', { - sku: '000345', - name: 'blue tie', - category: 'clothing', - unitPrice: 3.49, - quantity: 2, + sku: '000345', + name: 'blue tie', + category: 'clothing', + unitPrice: 3.49, + quantity: 2, currency: 'GBP' }); ``` @@ -1189,10 +1189,10 @@ The `trackSocialInteraction` method takes three parameters: The method is executed in as: ```javascript -snowplow('trackSocialInteraction', { - action: string, - network: string, - target: string +snowplow('trackSocialInteraction', { + action: string, + network: string, + target: string }); ``` @@ -1200,8 +1200,8 @@ For example: ```javascript snowplow('trackSocialInteraction', { - action: 'like', - network: 'facebook', + action: 'like', + network: 'facebook', target: 'pbz00123' }); ``` @@ -1235,7 +1235,7 @@ We want to be able to identify people who've clicked on ads e.g. in a marketing Visit website ``` -For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at .) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. +For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at `http://mysite.com/myproduct.html`.) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. #### Anatomy of the query parameters @@ -1778,10 +1778,10 @@ As an example, `trackConsentGranted` will store one consent document as a cust ```javascript snowplow('trackConsentGranted', - id: '1234', - version: '5', - name: 'consent_document', - description: 'a document granting consent', + id: '1234', + version: '5', + name: 'consent_document', + description: 'a document granting consent', expiry: '2020-11-21T08:00:00.000Z' ); ``` @@ -1906,8 +1906,8 @@ try { var user = getUser() } catch(e) { snowplow('trackError', { - message: 'Cannot get user object', - filename: 'shop.js', + message: 'Cannot get user object', + filename: 'shop.js', error: e }); } diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/quick-start-guide/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/quick-start-guide/index.md index a5ac91fa3f..c84387384d 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/quick-start-guide/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/quick-start-guide/index.md @@ -22,7 +22,7 @@ Follow these instructions to quickly implement a Snowplow web tracker with defau - + Getting started with sending events using the JavaScript tracker is very similar to other web analytics vendors like Google Analytics, Adobe Analytics, etc. The process involves the following high level steps: @@ -33,7 +33,7 @@ The process involves the following high level steps: - If manually inserting the tag into your website or tag management solution: Snowplow BDP users can generate a tag snippet in the Snowplow BDP Console [here](https://console.snowplowanalytics.com/tag-generator). Other users can use and edit the standard tag [here](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracker-setup/index.md). ```javascript - ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","{{URL to sp.js}}","snowplow")); + ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments) };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1; n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","{{URL to sp.js}}","snowplow")); ``` - Once you’ve generated your tag add it to all the pages you’d like to track: @@ -44,7 +44,7 @@ The process involves the following high level steps: - Configure an instance of the tracker by calling `newTracker` with your desired properties. ```javascript -window.snowplow('newTracker', 'sp1', '{{collector_url}}', { +window.snowplow('newTracker', 'sp1', '{{collector_url}}', { appId: 'my-app-id' }) ``` @@ -62,8 +62,8 @@ Rather than adding the tag snippet directly, you may wish to use an alternative - Use the Snowplow Plugin in the [analytics npm package](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracker-setup/snowplow-plugin-for-analytics-npm-package/index.md). - - + + Getting started with sending events using the Browser Tracker will be familiar for anyone who is used to installing npm packages into their web apps and is designed to work with frameworks such as React, Angular and Vue. @@ -83,8 +83,8 @@ import { newTracker, trackPageView } from "@snowplow/browser-tracker"; - Configure an instance of the tracker by calling `newTracker(...)` with your desired properties. This will create a module level instance of your tracker. You don't need to keep a reference to it. ```javascript -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ ], }) ``` @@ -95,7 +95,7 @@ newTracker('sp1', '{{collector_url}}', { trackPageView(); ``` - + ## What's tracked with the default configuration? diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/index.md index a9871ee489..0da56c04a4 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/index.md @@ -35,30 +35,19 @@ Button click events are **automatically tracked** once configured. Download from GitHub Releases (Recommended) - Github Releases (plugins.umd.zip) + Github Releases (plugins.umd.zip) Available on jsDelivr - jsDelivr - (latest) + jsDelivr (latest) Available on unpkg - unpkg - (latest) + unpkg (latest) @@ -97,8 +86,8 @@ window.snowplow('enableButtonClickTracking'); ```javascript import { enableButtonClickTracking, enableButtonClickTracking } from '@snowplow/browser-plugin-button-click-tracking'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ ButtonClickTrackingPlugin() ], }); @@ -251,7 +240,7 @@ This will result in the following event: "schema": "iglu:com.snowplowanalytics.snowplow/button_click/jsonschema/1-0-0", "data": { // Note the label is "My custom label", not "Click me" - "label": "My custom label", + "label": "My custom label", } } ``` diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/campaigns-utms/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/campaigns-utms/index.md index 4b23172fb2..2c44c8ec74 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/campaigns-utms/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/campaigns-utms/index.md @@ -37,7 +37,7 @@ We want to be able to identify people who've clicked on ads e.g. in a marketing Visit website ``` -For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at .) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. +For the prospective customer clicking on the link, adding the query parameters does not change the user experience. (The user is still directed to the webpage at `http://mysite.com/myproduct.html`.) But Snowplow then has access to the fields given in the query string, and uses them to identify this user as originating from the October Newsletter, an email marketing campaign with campaign id = cn0201. ### Anatomy of the query parameters diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/enhanced/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/enhanced/index.md index e58bf7a200..91f434fa75 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/enhanced/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/enhanced/index.md @@ -9,6 +9,7 @@ sidebar_position: 70 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ``` + :::tip This plugin has been superseded by the [Snowplow ecommerce plugin](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/index.md). We highly recommend using this newer plugin, which is more fully featured and allows you to use the DBT model we provide. ::: @@ -34,7 +35,7 @@ Enhanced ecommerce events must be **manually tracked**. **Note:** The links to the CDNs above point to the current latest version. You should pin to a specific version when integrating this plugin on your website if you are using a third party CDN in production. ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-enhanced-ecommerce@latest/dist/index.umd.min.js", ["snowplowEnhancedEcommerce", "EnhancedEcommercePlugin"] ); @@ -51,8 +52,8 @@ window.snowplow('addPlugin', import { newTracker, trackPageView } from '@snowplow/browser-tracker'; import { EnhancedEcommercePlugin, trackEnhancedEcommerceAction } from '@snowplow/browser-plugin-enhanced-ecommerce'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ EnhancedEcommercePlugin() ], }); ``` diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/original/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/original/index.md index 9ea61e75f7..3cba15b885 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/original/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/original/index.md @@ -9,6 +9,7 @@ sidebar_position: 70 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ``` + :::tip This plugin has been superseded by the [Snowplow ecommerce plugin](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ecommerce/index.md). We highly recommend using this newer plugin, which is more fully featured and allows you to use the DBT model we provide. ::: @@ -38,7 +39,7 @@ Original ecommerce events must be **manually tracked**. **Note:** The links to the CDNs above point to the current latest version. You should pin to a specific version when integrating this plugin on your website if you are using a third party CDN in production. ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-ecommerce@latest/dist/index.umd.min.js", ["snowplowEcommerce", "EcommercePlugin"] ); @@ -55,8 +56,8 @@ window.snowplow('addPlugin', import { newTracker, trackPageView } from '@snowplow/browser-tracker'; import { EcommercePlugin, addTrans, addItem, trackTrans } from '@snowplow/browser-plugin-ecommerce'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ EcommercePlugin() ], }); ``` diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/focalmeter/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/focalmeter/index.md index 1932ba1083..3c333f59a3 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/focalmeter/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/focalmeter/index.md @@ -44,9 +44,7 @@ The Focal Meter integration is **automatic** once configured. - `yarn add @snowplow/browser-plugin-focalmeter@focalmeter_plugin` - `pnpm add @snowplow/browser-plugin-focalmeter@focalmeter_plugin` - - - + ## Initialization @@ -76,8 +74,8 @@ window.snowplow('enableFocalMeterIntegration', { import { newTracker } from '@snowplow/browser-tracker'; import { FocalMeterPlugin, enableFocalMeterIntegration } from '@snowplow/browser-plugin-focalmeter'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ FocalMeterPlugin() ], }); diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/form-tracking/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/form-tracking/index.md index f8ed25c203..a8064aa5d8 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/form-tracking/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/form-tracking/index.md @@ -42,8 +42,7 @@ Form events are **automatically tracked** once configured. - `yarn add @snowplow/browser-plugin-form-tracking` - `pnpm add @snowplow/browser-plugin-form-tracking` - - + ## Enable form tracking @@ -52,7 +51,7 @@ Form events are **automatically tracked** once configured. ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-form-tracking@latest/dist/index.umd.min.js", ["snowplowFormTracking", "FormTrackingPlugin"] ); @@ -69,8 +68,8 @@ This is part of the `@snowplow/browser-plugin-form-tracking` plugin. You need to import { newTracker, trackPageView } from '@snowplow/browser-tracker'; import { FormTrackingPlugin, enableFormTracking } from '@snowplow/browser-plugin-form-tracking'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ FormTrackingPlugin() ], }); diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ga-cookies/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ga-cookies/index.md index 74693f2427..06c6f97075 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ga-cookies/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/ga-cookies/index.md @@ -37,8 +37,7 @@ GA cookies information is **automatically tracked** once configured. - `yarn add @snowplow/browser-plugin-ga-cookies` - `pnpm add @snowplow/browser-plugin-ga-cookies` - - + ## Initialization diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/index.md index cc79c0e3e9..3539d77269 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/index.md @@ -313,18 +313,19 @@ setUserIdFromCookie('cookieid'); It's possible to retrieve certain properties for use in your code, including the user ID, [page view ID](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/#get-page-view-id), and [cookie values](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/#retrieving-cookie-properties-from-the-tracker), using a tracker callback. This is an advanced usage of the tracker. ```mdx-code-block -import RetrieveValues from "@site/docs/reusable/javascript-tracker-retrieve-values/_index.md" +import RetrieveValuesJs from "@site/docs/reusable/javascript-tracker-retrieve-values/_javascript.md" +import RetrieveValuesBrowser from "@site/docs/reusable/javascript-tracker-retrieve-values/_browser.md" ``` - + - + diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/link-click/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/link-click/index.md index 277d721b3c..27c8decc52 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/link-click/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/link-click/index.md @@ -41,8 +41,7 @@ Link click events are **automatically tracked** once configured. - `yarn add @snowplow/browser-plugin-link-click-tracking` - `pnpm add @snowplow/browser-plugin-link-click-tracking` - - + ## Enable link click tracking @@ -53,7 +52,7 @@ Turn on link click tracking like this: ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-link-click-tracking@latest/dist/index.umd.min.js", ["snowplowLinkClickTracking", "LinkClickTrackingPlugin"] ); @@ -70,8 +69,8 @@ Link click tracking is part of a separate plugin, `@snowplow/browser-plugin-link import { newTracker } from '@snowplow/browser-tracker'; import { LinkClickTrackingPlugin, enableLinkClickTracking } from '@snowplow/browser-plugin-link-click-tracking'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ LinkClickTrackingPlugin() ], }); diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/media/youtube/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/media/youtube/index.md index 830bf0a95c..608b70eca2 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/media/youtube/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/media/youtube/index.md @@ -37,8 +37,7 @@ YouTube media events and entities are **automatically tracked** once configured. - `yarn add @snowplow/browser-plugin-youtube-tracking` - `pnpm add @snowplow/browser-plugin-youtube-tracking` - - + ## Quick Start diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/optimizely/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/optimizely/index.md index 77dd1ab723..ddd33a3843 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/optimizely/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/optimizely/index.md @@ -35,7 +35,7 @@ Support for OptimizelyX has been introduced in the tracker, you can have a look **Note:** The links to the CDNs above point to the current latest version. You should pin to a specific version when integrating this plugin on your website if you are using a third party CDN in production. ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-optimizely-x@latest/dist/index.umd.min.js", ["snowplowOptimizelyX", "OptimizelyXPlugin"] ); @@ -52,8 +52,8 @@ window.snowplow('addPlugin', import { newTracker, trackPageView } from '@snowplow/browser-tracker'; import { OptimizelyXPlugin } from '@snowplow/browser-plugin-optimizely-x'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ OptimizelyXPlugin() ], }); ``` @@ -93,8 +93,7 @@ If you’re planning on leveraging the entity’s variation names, you’ll have - `yarn add @snowplow/browser-plugin-optimizely` - `pnpm add @snowplow/browser-plugin-optimizely` - - + ### Initialization @@ -103,7 +102,7 @@ If you’re planning on leveraging the entity’s variation names, you’ll have ```javascript -window.snowplow('addPlugin', +window.snowplow('addPlugin', "https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-optimizely@latest/dist/index.umd.min.js", ["snowplowOptimizely", "OptimizelyPlugin"], [true, true, true, true, true, true, true] @@ -112,14 +111,14 @@ window.snowplow('addPlugin', The parameter array of booleans is used to initialize the plugin. If you do not include this, all the Optimizely contexts will be included. To alter this behavior you can flip some of the booleans. The array represent enabling the following contexts: ```javascript -[ - summary: boolean, - experiments: boolean, - states: boolean, - variations: boolean, - visitor: boolean, - audiences: boolean, - dimensions: boolean +[ + summary: boolean, + experiments: boolean, + states: boolean, + variations: boolean, + visitor: boolean, + audiences: boolean, + dimensions: boolean ] ``` @@ -130,8 +129,8 @@ The parameter array of booleans is used to initialize the plugin. If you do not import { newTracker, trackPageView } from '@snowplow/browser-tracker'; import { OptimizelyPlugin } from '@snowplow/browser-plugin-optimizely'; -newTracker('sp1', '{{collector_url}}', { - appId: 'my-app-id', +newTracker('sp1', '{{collector_url}}', { + appId: 'my-app-id', plugins: [ OptimizelyPlugin() ], }); ``` diff --git a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/index.md b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/index.md index 0d79d4f2d1..1331b2c378 100644 --- a/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/index.md +++ b/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/index.md @@ -167,18 +167,19 @@ When the JavaScript Tracker loads on a page, it generates a new page view UUID a It's possible to retrieve certain properties for use in your code, including the page view UUID, [user ID](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/#getting-user-id-once-set), and [cookie values](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/cookies-and-local-storage/getting-cookie-values/#retrieving-cookie-properties-from-the-tracker), using a tracker callback. This is an advanced usage of the tracker. ```mdx-code-block -import RetrieveValues from "@site/docs/reusable/javascript-tracker-retrieve-values/_index.md" +import RetrieveValuesJs from "@site/docs/reusable/javascript-tracker-retrieve-values/_javascript.md" +import RetrieveValuesBrowser from "@site/docs/reusable/javascript-tracker-retrieve-values/_browser.md" ``` - + - + diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-1-0-java-0-5-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-1-0-java-0-5-0/index.md index 4bf9f66e18..a7576acfdd 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-1-0-java-0-5-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-1-0-java-0-5-0/index.md @@ -396,9 +396,9 @@ The arguments are as follows: | **Argument** | **Description** | **Required?** | **Validation** | | --- | --- | --- | --- | -| `eventData` | The properties of the event | Yes | Map | -| `context` | Custom context for the event | No | Map | -| `timestamp` | Optional timestamp for the event | No | Long | +| `eventData` | The properties of the event | Yes | `Map` | +| `context` | Custom context for the event | No | `Map` | +| `timestamp` | Optional timestamp for the event | No | `Long` | Example: diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-3-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-3-0/index.md index 858f92dcd8..c92d5c99b6 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-3-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-3-0/index.md @@ -63,7 +63,7 @@ Tracker t2 = new Tracker As you can see there is a fair amount of modularity to the Trackers creation. -The below are required arguments for the 'TrackerBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `TrackerBuilder({{ ... }})` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | @@ -662,7 +662,7 @@ The `Context` is used for caching events in a [SQLite database](http://develo Don't confuse the Android context with Snowplow's own custom contexts - they are completely separate things. -The below are required arguments for the 'EmitterBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `'EmitterBuilder({{ ... }})'` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-4-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-4-0/index.md index b8486df7f8..b715816a9b 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-4-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-4-0/index.md @@ -69,7 +69,7 @@ Tracker t2 = new Tracker As you can see there is a fair amount of modularity to the Trackers creation. -The below are required arguments for the 'TrackerBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `TrackerBuilder({{ ... }})` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | @@ -692,7 +692,7 @@ The `Context` is used for caching events in a [SQLite database](http://develo Don't confuse the Android context with Snowplow's own custom contexts - they are completely separate things. -The below are required arguments for the 'EmitterBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `'EmitterBuilder({{ ... }})'` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-5-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-5-0/index.md index 60e959e1b3..e3435984a6 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-5-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-5-0/index.md @@ -114,7 +114,7 @@ Tracker t2 = new Tracker As you can see there is a fair amount of modularity to the Trackers creation. -The below are required arguments for the 'TrackerBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `TrackerBuilder({{ ... }})` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | @@ -1044,7 +1044,7 @@ The `Context` is used for caching events in a [SQLite database](http://develo Don't confuse the Android context with Snowplow's own custom contexts - they are completely separate things. -The below are required arguments for the 'EmitterBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `'EmitterBuilder({{ ... }})'` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-6-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-6-0/index.md index 4b46f540a0..333e6e01e9 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-6-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-6-0/index.md @@ -122,7 +122,7 @@ Tracker.init(new Tracker As you can see there is a fair amount of modularity to the Trackers creation. -The below are required arguments for the 'TrackerBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `TrackerBuilder({{ ... }})` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | @@ -1093,7 +1093,7 @@ The `Context` is used for caching events in a [SQLite database](http://develo Don't confuse the Android context with Snowplow's own custom contexts - they are completely separate things. -The below are required arguments for the 'EmitterBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `'EmitterBuilder({{ ... }})'` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-7-0/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-7-0/index.md index e4bd933ede..472f0ab1f4 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-7-0/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/previous-versions/android-tracker/android-0-7-0/index.md @@ -113,7 +113,7 @@ Tracker.init(new Tracker As you can see there is a fair amount of modularity to the Trackers creation. -The below are required arguments for the 'TrackerBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `TrackerBuilder({{ ... }})` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | @@ -1084,7 +1084,7 @@ The `Context` is used for caching events in a [SQLite database](http://develo Don't confuse the Android context with Snowplow's own custom contexts - they are completely separate things. -The below are required arguments for the 'EmitterBuilder({{ ... }})' segment of the constructor: +The below are required arguments for the `'EmitterBuilder({{ ... }})'` segment of the constructor: | **Argument Name** | **Description** | **Required?** | | --- | --- | --- | diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/ecommerce-tracking/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/ecommerce-tracking/index.md index 956b515d99..3efbdd7a77 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/ecommerce-tracking/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/ecommerce-tracking/index.md @@ -9,6 +9,7 @@ sidebar_position: 70 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ``` + :::note Snowplow ecommerce tracking was added in version 5.4.0. With the addition of these new ecommerce events and entities, we have deprecated the old `EcommerceTransaction` and `EcommerceTransactionItem` events. [Migration guide](docs/collecting-data/collecting-from-own-applications/mobile-trackers/migration-guides/migration-guide-to-new-ecommerce/index.md). ::: @@ -28,9 +29,9 @@ Ecommerce events are tracked like normal Snowplow events. For example, tracking let tracker = Snowplow.createTracker(namespace: "appTracker", endpoint: "https://snowplow-collector-url.com") let product = ProductEntity( - id: "productId", - category: "category", - currency: "GBP", + id: "productId", + category: "category", + currency: "GBP", price: 100 ) let event = ProductViewEvent(product: product) @@ -47,9 +48,9 @@ val tracker = Snowplow.createTracker( ) val event = ProductViewEvent(ProductEntity( - id = "productId", - category = "category", - currency = "GBP", + id = "productId", + category = "category", + currency = "GBP", price = 100 ) ) @@ -72,14 +73,14 @@ ProductViewEvent event = new ProductViewEvent(new ProductEntity( "GBP", // currency 100 // price ) -); +); tracker.track(event); ``` -Add or update properties using setters. For example, adding data to a PromotionEntity: +Add or update properties using setters. For example, adding data to a PromotionEntity: @@ -126,7 +127,7 @@ This table lists all the ecommerce events. `RefundEvent` | Track a transaction partial or complete refund. -Each ecommerce event is a [self-describing](docs/collecting-data/collecting-from-own-applications/mobile-trackers/custom-tracking-using-schemas/index.md) event using a single schema, +Each ecommerce event is a [self-describing](docs/collecting-data/collecting-from-own-applications/mobile-trackers/custom-tracking-using-schemas/index.md) event using a single schema, `iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2`.
@@ -153,9 +154,9 @@ Tracking a visit to a details screen for a specific product. ```swift let product = ProductEntity( - id: "plow2", - category: "snow.clearance.ploughs.large", - currency: "NOK", + id: "plow2", + category: "snow.clearance.ploughs.large", + currency: "NOK", price: 5000 ) let event = ProductViewEvent(product: product) @@ -168,9 +169,9 @@ tracker.track(event) ```kotlin val product = ProductEntity( - id = "plow2", - category = "snow.clearance.ploughs.large", - currency = "NOK", + id = "plow2", + category = "snow.clearance.ploughs.large", + currency = "NOK", price = 5000 ) val event = ProductViewEvent(product) @@ -188,7 +189,7 @@ ProductViewEvent event = new ProductViewEvent(new ProductEntity( "NOK", // currency 5000 // price ) -); +); tracker.track(event); ``` @@ -205,9 +206,9 @@ Tracking one or more products being added to a cart. ```swift let product = ProductEntity( - id: "productId", - category: "clothes/shirts", - currency: "EUR", + id: "productId", + category: "clothes/shirts", + currency: "EUR", price: 100.50 ) let cart = CartEntity(totalValue: 200, currency: "EUR") @@ -221,9 +222,9 @@ tracker.track(event) ```kotlin val product = ProductEntity( - id = "productId", - category = "clothes/shirts", - currency = "EUR", + id = "productId", + category = "clothes/shirts", + currency = "EUR", price = 100.50 ) val cart = CartEntity(totalValue = 200, currency = "EUR") @@ -277,9 +278,9 @@ tracker.track(event) ```kotlin val product = ProductEntity( - id = "productId", - category = "clothes/shirts", - currency = "EUR", + id = "productId", + category = "clothes/shirts", + currency = "EUR", price = 100.50 ) val cart = CartEntity(totalValue = 200, currency = "EUR") @@ -330,9 +331,9 @@ tracker.track(event) ```kotlin val product = ProductEntity( - id = "productId", - category = "software", - currency = "USD", + id = "productId", + category = "software", + currency = "USD", price = 99.99 ) val event = ProductListViewEvent(listOf(product), name = "snowplowProducts") @@ -380,9 +381,9 @@ tracker.track(event) ```kotlin val product = ProductEntity( - id = "productId", - category = "software", - currency = "USD", + id = "productId", + category = "software", + currency = "USD", price = 99.99 ) val event = ProductListClickEvent(product, name = "snowplowProducts") @@ -457,10 +458,10 @@ Track the completion of a purchase or transaction, along with common transaction ```swift let transaction = TransactionEntity( - transactionId: "id-123", - revenue: 50000, - currency: "JPY", - paymentMethod: "debit", + transactionId: "id-123", + revenue: 50000, + currency: "JPY", + paymentMethod: "debit", totalQuantity: 2 ) let event = TransactionEvent(transaction) @@ -473,7 +474,7 @@ tracker.track(event) ```kotlin val transaction = TransactionEntity( - id = "id-123", + id = "id-123", revenue = 50000, currency = "JPY", paymentMethod = "debit", @@ -510,15 +511,15 @@ Track an error occurring during a transaction. ```swift let transaction = TransactionEntity( - transactionId: "id-123", - revenue: 50000, - currency: "JPY", - paymentMethod: "debit", + transactionId: "id-123", + revenue: 50000, + currency: "JPY", + paymentMethod: "debit", totalQuantity: 2 ) let event = TransactionErrorEvent( - transaction: transaction, - errorCode: "E05", + transaction: transaction, + errorCode: "E05", errorDescription: "connection_failure" ) @@ -530,14 +531,14 @@ tracker.track(event) ```kotlin val transaction = TransactionEntity( - id = "id-123", + id = "id-123", revenue = 50000, currency = "JPY", paymentMethod = "debit", totalQuantity = 2 ) val event = TransactionErrorEvent( - transaction = transaction, + transaction = transaction, errorCode = "E05", errorDescription = "connection_failure" ) @@ -577,7 +578,7 @@ Track a refund being requested for part of, or the entirety of, a transaction. ```swift let event = RefundEvent( transactionId: "id-123", // use the transaction ID from the original Transaction event - refundAmount: 20000, + refundAmount: 20000, currency: "JPY" ) diff --git a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/visionos/index.md b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/visionos/index.md index 92b1083a0a..c3234914c4 100644 --- a/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/visionos/index.md +++ b/docs/collecting-data/collecting-from-own-applications/mobile-trackers/tracking-events/visionos/index.md @@ -9,6 +9,7 @@ sidebar_position: 110 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; ``` + :::note Snowplow visionOS tracking was added in version 6.0.0. ::: @@ -57,9 +58,9 @@ In this example, a window group entity is added to an [Ecommerce](docs/collectin ```swift let product = ProductEntity( - id: "productId", - category: "category", - currency: "GBP", + id: "productId", + category: "category", + currency: "GBP", price: 100 ) let event = ProductViewEvent(product: product) @@ -75,7 +76,7 @@ Use the `OpenImmersiveSpaceEvent` and `DismissImmersiveSpaceEvent` to automatica ```swift let tracker = Snowplow.createTracker( - namespace: "appTracker", + namespace: "appTracker", endpoint: "https://snowplow-collector-url.com" ) diff --git a/docs/collecting-data/collecting-from-own-applications/python-tracker/previous_versions/python-v0-15/tracking-specific-events/index.md b/docs/collecting-data/collecting-from-own-applications/python-tracker/previous_versions/python-v0-15/tracking-specific-events/index.md index 00e2a46b28..eeba9c0c0b 100644 --- a/docs/collecting-data/collecting-from-own-applications/python-tracker/previous_versions/python-v0-15/tracking-specific-events/index.md +++ b/docs/collecting-data/collecting-from-own-applications/python-tracker/previous_versions/python-v0-15/tracking-specific-events/index.md @@ -502,10 +502,10 @@ tracker.track_form_submit("signupForm", ["signup__warning"], {"name": "email", " Use `track_site_search()` to track a what user searches on your website. Arguments are: -| **Argument** | **Description** | **Required?** | ******Type****** | +| **Argument** | **Description** | **Required?** | **Type** | | --- | --- | --- | --- | | `terms` | Search terms | Yes | List(str) | -| `filters` | Filters applied to search | No | List(dict{str:str | +| `filters` | Filters applied to search | No | List(Dict[str,str]) | | `total_results` | Total number of results | No | Integer | | `page_results` | Number of pages of results | No | Integer | | `context` | Custom context for the event | No | List(SelfDescribingJson) | diff --git a/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/index.md b/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/index.md index c13077139b..d4bbcc2a40 100644 --- a/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/index.md +++ b/docs/collecting-data/collecting-from-own-applications/python-tracker/setup/index.md @@ -8,6 +8,7 @@ sidebar_position: 10 import {versions} from '@site/src/componentVersions'; import CodeBlock from '@theme/CodeBlock'; ``` + ### Tracker compatibility As a programming language that lets you work more quickly and integrate your systems more effectively, Python is available in a huge number of different computing environments and platforms, from Civilization IV through [Django framework](https://www.djangoproject.com/) to Ubuntu One. diff --git a/docs/collecting-data/configuring-collector/ui/index.md b/docs/collecting-data/configuring-collector/ui/index.md index 84f1e4bb47..0670140c25 100644 --- a/docs/collecting-data/configuring-collector/ui/index.md +++ b/docs/collecting-data/configuring-collector/ui/index.md @@ -67,7 +67,7 @@ To be able to post sample requests in the documentation you need to click the ` The endpoint for the API is: -[https://console.snowplowanalytics.com/api/msc/v1/organizations/**{organizationId}**/resources/v1/pipelines/**{pipelineId}**/configuration/collector](https://console.snowplowanalytics.com/api/msc/v1/organizations/{organizationId}/resources/v1/pipelines/{pipelineId}/configuration/collector) +`https://console.snowplowanalytics.com/api/msc/v1/organizations/{organizationId}/resources/v1/pipelines/{pipelineId}/configuration/collector` and the only supported HTTP verb is `GET`. diff --git a/docs/first-steps/tracking/index.md b/docs/first-steps/tracking/index.md index a2aa1d1688..de116b9fc7 100644 --- a/docs/first-steps/tracking/index.md +++ b/docs/first-steps/tracking/index.md @@ -114,8 +114,7 @@ If you are already using Google Tag Manager to add various code snippets to your - Set it to fire on 'All Pages' or a trigger of your choosing - You can preview your tag to send some events before publishing it - - + The JavaScript tracker captures many events (e.g. page views) automatically, so you should start accumulating your first events as soon as the changes are rolled out to your users. diff --git a/docs/getting-started-on-community-edition/quick-start/index.md b/docs/getting-started-on-community-edition/quick-start/index.md index 170e3d9233..bccad68b00 100644 --- a/docs/getting-started-on-community-edition/quick-start/index.md +++ b/docs/getting-started-on-community-edition/quick-start/index.md @@ -48,9 +48,8 @@ Configure a Google Cloud service account. See [details on using the service acco - Create a new JSON Key and store it locally - Create the environment variable by running `export GOOGLE_APPLICATION_CREDENTIALS="KEY PATH"` in your terminal - - - + + Install the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli). @@ -196,8 +195,7 @@ If you [used our `base` module](#set-up-a-vpc-to-deploy-into), you will need to * `subnet_id_lb`: use the identifier of the `iglu-agw1` subnet from `base` * `subnet_id_servers`: use the identifier of the `iglu1` subnet from `base` - - + To update your input variables, you’ll need to know a few things: diff --git a/docs/getting-started-on-community-edition/what-is-deployed/index.md b/docs/getting-started-on-community-edition/what-is-deployed/index.md index ccb753f849..ee47bc0670 100644 --- a/docs/getting-started-on-community-edition/what-is-deployed/index.md +++ b/docs/getting-started-on-community-edition/what-is-deployed/index.md @@ -279,9 +279,8 @@ See the following Terraform modules for further details on the resources, defaul * [Transformer Kinesis](https://registry.terraform.io/modules/snowplow-devops/transformer-kinesis-ec2/aws/latest) * [Redshift Loader](https://registry.terraform.io/modules/snowplow-devops/redshift-loader-ec2/aws/latest) - - - + + The [BigQuery Loader](/docs/pipeline-components-and-applications/loaders-storage-targets/bigquery-loader/index.md) is a set of applications that loads enriched events into BigQuery. @@ -302,9 +301,8 @@ See the following Terraform modules for further details on the resources, defaul * Snowflake Loader component ([AWS](https://registry.terraform.io/modules/snowplow-devops/snowflake-loader-ec2/aws/latest), [Azure](https://registry.terraform.io/modules/snowplow-devops/snowflake-loader-vmss/azurerm/latest)) * Snowflake Streaming Loader ([AWS](https://registry.terraform.io/modules/snowplow-devops/snowflake-streaming-loader-ec2/aws/latest)) - - - + + [RDB Loader](/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/index.md) is a set of applications that loads enriched events into Databricks. @@ -312,9 +310,8 @@ See the following Terraform modules for further details on the resources, defaul * [Transformer Kinesis](https://registry.terraform.io/modules/snowplow-devops/transformer-kinesis-ec2/aws/latest) * [Databricks Loader](https://registry.terraform.io/modules/snowplow-devops/databricks-loader-ec2/aws/latest) - - - + + [Lake Loader](/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/index.md) is an application that loads enriched events into a data lake so that they can be queried via Databricks (or other means). diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/index.md index 887b51f618..04ce025541 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/index.md @@ -8,7 +8,7 @@ sidebar_position: 40 This page details general configurations that can apply across many of our packages, each package has specific configuration variables that define how the models run, please see each child page for the specifics of each package. -::: +::: ## Variables @@ -56,8 +56,8 @@ Since there are many different situations, we've created the following table to | | Adapter supports UC and UC Enabled | Adapter supports UC and UC not enabled | Adapter does not support UC | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| Events land in default `atomic` schema | `snowplow__databricks_catalog` = '{name_of_catalog}' | Nothing needed | `snowplow__databricks_catalog` = 'atomic' | -| Events land in custom schema (not `atomic`) | `snowplow__atomic_schema` = '{name_of_schema}' `snowplow__databricks_catalog` = '{name_of_catalog}' | `snowplow__atomic_schema` = '{name_of_schema}' | `snowplow__atomic_schema` = '{name_of_schema}' `snowplow__databricks_catalog` = '{name_of_schema}' | +| Events land in default `atomic` schema | `snowplow__databricks_catalog = '{name_of_catalog}'` | Nothing needed | `snowplow__databricks_catalog = 'atomic'` | +| Events land in custom schema (not `atomic`) | `snowplow__atomic_schema = '{name_of_schema}'` `snowplow__databricks_catalog = '{name_of_catalog}'` | `snowplow__atomic_schema = '{name_of_schema}'` | `snowplow__atomic_schema = '{name_of_schema}'` `snowplow__databricks_catalog = '{name_of_schema}'` | #### Optimization of models diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-custom-models/examples/using-different-sessionisation/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-custom-models/examples/using-different-sessionisation/index.md index 4f9c5114a4..832e8dd2ae 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-custom-models/examples/using-different-sessionisation/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-custom-models/examples/using-different-sessionisation/index.md @@ -5,15 +5,15 @@ sidebar_position: 50 Using a different sessionisation is a rare use case for our packages, but can be done in 2 different ways. The use case for each approach is often different so we treat them differently on this page. -## Tweaking the session identifiers +## Tweaking the session identifiers If you only need to slightly alter the identifiers, such as using an entity value where it exists instead of just the default fields, you can do this by following the details in the [custom identifiers](/docs/modeling-your-data/modeling-your-data-with-dbt/package-features/identity-stitching/index.md) page to alter this via the existing variables of our packages. ## Using the incremental logic for all custom models -The more large-scale use case is when you wish to take advantage of our [incremental sessionisation logic](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/incremental-processing/index.md), but have no need for any of the other derived tables in our packages. A common use case for this is when you want to do daily aggregates and reporting, in this case your "session" identifier is actually the day of the event. +The more large-scale use case is when you wish to take advantage of our [incremental sessionisation logic](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/incremental-processing/index.md), but have no need for any of the other derived tables in our packages. A common use case for this is when you want to do daily aggregates and reporting, in this case your "session" identifier is actually the day of the event. For this purpose, rather than disable all the models you don't need, it would be easier to use the `base` macros and tables at the root of your project, or stand up a standalone project. For this purpose we have the [dbt-template](https://github.com/snowplow-incubator/dbt-template) repository which has all the core logic of our packages set up, including all the variables and models. -Once you have forked/copied this project, you will need to replace all instances of ` across the package with the name you want for this project. This includes file names, not just a find and replace in the files. +Once you have forked/copied this project, you will need to replace all instances of `` across the package with the name you want for this project. This includes file names, not just a find and replace in the files. You can then make changes to the variables as required, for example the following changes would give you a daily "sessionisation" to allow you to easily do incremental daily reporting: diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md index 3a7a083ced..f8df5ddc33 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-attribution-data-model/index.md @@ -125,7 +125,7 @@ You will also need a table where the conversion events are stored. If you use th To fully finish the config you could overwrite the `snowplow__conversion_clause` variable in your project.yml, in case you would want to filter on specific types of conversions. You should also set the `snowplow__conversion_stitching` variable to true, if you have stitched_user_id in your conversions table. ::: -In case you store your conversion events elsewhere in the data warehouse (e.g. because those are transactional data that you decide you do not want to process through Snowplow), you can mutate that source table into the [format of the conversions table](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md#2-enabling-conversions-in-the-conversions-module) generated by the unified package, store it as a sql view, and refer to that in the variable `snowplow__conversion_source` (in the format of `schema.view_name`). +In case you store your conversion events elsewhere in the data warehouse (e.g. because those are transactional data that you decide you do not want to process through Snowplow), you can mutate that source table into the [format of the conversions table](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md#2-enabling-conversions-in-the-conversions-module) generated by the unified package, store it as a sql view, and refer to that in the variable `snowplow__conversion_source` (in the format of `schema.view_name`). You could also union multiple sources (e.g. one transactional event data for automatic conversion events not dictated by user actions and then the rest, ending up in the unified_conversions table). @@ -214,7 +214,7 @@ You can do either for campaigns, too, with the `snowplow__channels_to_exclude` a In order to reduce unnecesarily long paths your can apply a number of path transformations that are created as part of user defined functions automatically in your warehouse by the package. -In order to apply these transformations, all you have to do is to define them in the `snowplow__path_transforms` variable as a list of dictionaries, with the transformation name as key and optionally the parameter as value (for `remove_if_last_and_not_all` and `remove_if_not_all`). If the transformation requires no parameter you can just use `null` as values for the dictionary. For more details on how to do this, check out the [configuration page](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/attribution/index.mdx) E.g.: {'exposure_path': null, 'remove_if_last_and_not_all': 'direct'} +In order to apply these transformations, all you have to do is to define them in the `snowplow__path_transforms` variable as a list of dictionaries, with the transformation name as key and optionally the parameter as value (for `remove_if_last_and_not_all` and `remove_if_not_all`). If the transformation requires no parameter you can just use `null` as values for the dictionary. For more details on how to do this, check out the [configuration page](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/attribution/index.mdx) E.g.: `{'exposure_path': null, 'remove_if_last_and_not_all': 'direct'}`
Path transform options @@ -228,7 +228,7 @@ In order to apply these transformations, all you have to do is to define them in 3. **`first`**: keep only the first occurrence of any event: `A → B → A` becomes `A → B`, best for brand awareness marketing 4. **`remove_if_last_and_not_all`**: requires a channel to be added as a parameter, which gets removed from the latest paths unless it removes the whole path as it is trying to reach a non-matching channel parameter: E.g target element: `A` path: `A → B → A → A` becomes `A → B` - + A common requirement is to take the **`last non-direct clicks`** only into account during attribution analysis. If you use the `remove_if_last_and_not_all` path transform with `direct` as the parameter to remove it from the end of the path (unless they are all direct) the `last-touch` attribution results should show the outcome you need. You can also filter out the direct channels altogether with the `snowplow__channels_to_exclude` variable. 5. **`remove_if_not_all`**: requires a channel to be added as a parameter, which gets removed from the path altogether unless it would result in the whole path's removal: E.g target element: `A` path: `A → B → A → A` becomes `B` diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-ecommerce-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-ecommerce-data-model/index.md index 2a50f27db3..26bd6ad863 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-ecommerce-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-ecommerce-data-model/index.md @@ -8,6 +8,7 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` +   diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-media-player-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-media-player-data-model/index.md index 2c3e63f699..45337f9f46 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-media-player-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-media-player-data-model/index.md @@ -11,6 +11,7 @@ import TabItem from '@theme/TabItem'; import ThemedImage from '@theme/ThemedImage'; import Badges from '@site/src/components/Badges'; ``` +     diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-normalize-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-normalize-data-model/index.md index a67d629db2..1c5765d03f 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-normalize-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-normalize-data-model/index.md @@ -11,6 +11,7 @@ import TabItem from '@theme/TabItem'; import ThemedImage from '@theme/ThemedImage'; import Badges from '@site/src/components/Badges'; ``` +     @@ -106,8 +107,9 @@ In general, it should only be required to run the script in this package once to The script should always be run from the **root** of your dbt project (the same level your `dbt_project.yml` file is at). ### Install python packages + :::caution -Python [>=3.7, <=3.10] is currently supported +Python versions between 3.7 and 3.10 (inclusive) are currently supported ::: diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/app-errors-module/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/app-errors-module/index.md index 8a777b7acd..9eb0f53334 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/app-errors-module/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/app-errors-module/index.md @@ -7,6 +7,7 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` + ```mdx-code-block diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/consent-module/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/consent-module/index.md index 6cf92dce9b..364870560e 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/consent-module/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/consent-module/index.md @@ -7,6 +7,7 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` + ```mdx-code-block diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md index a4967c9bf0..7a2edb00b8 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/conversions/index.md @@ -95,9 +95,9 @@ vars: snowplow__conversion_events: [ { - "name": "contact_page_view", + "name": "contact_page_view", "condition": "event_name = 'page_view' and page_url like '%contact-us%", - "list_events": true + "list_events": true } ] ``` @@ -116,8 +116,8 @@ vars: snowplow__conversion_events: [ { - "name": "transact", - "condition": "event_name = 'sign_up'", + "name": "transact", + "condition": "event_name = 'sign_up'", } ] ``` @@ -140,9 +140,9 @@ vars: snowplow__conversion_events: [ { - "name": "transact", - "condition": "UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_SNOWPLOW_ECOMMERCE_ACTION_1:type::varchar = 'transaction'", - "value": "CONTEXTS_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_TRANSACTION_1[0]:revenue::decimal(22,2)", + "name": "transact", + "condition": "UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_SNOWPLOW_ECOMMERCE_ACTION_1:type::varchar = 'transaction'", + "value": "CONTEXTS_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_TRANSACTION_1[0]:revenue::decimal(22,2)", "default_value":0 } ] @@ -157,7 +157,7 @@ vars: snowplow__conversion_events: [ { - "name": "transact", + "name": "transact", "condition": "UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_SNOWPLOW_ECOMMERCE_ACTION_1_0_0.type = 'transaction'", "value": "CONTEXTS_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_TRANSACTION_1_0_0[SAFE_OFFSET(0)].revenue", "default_value":0 @@ -174,9 +174,9 @@ vars: snowplow__conversion_events: [ { - "name": "transact", - "condition": "UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_SNOWPLOW_ECOMMERCE_ACTION_1.type = 'transaction'", - "value": "CONTEXTS_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_TRANSACTION_1[0].revenue", + "name": "transact", + "condition": "UNSTRUCT_EVENT_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_SNOWPLOW_ECOMMERCE_ACTION_1.type = 'transaction'", + "value": "CONTEXTS_COM_SNOWPLOWANALYTICS_SNOWPLOW_ECOMMERCE_TRANSACTION_1[0].revenue", "default_value":0 } ] @@ -188,26 +188,26 @@ vars: ```yml title="dbt_project.yml" vars: snowplow_unified: - snowplow__entities_or_sdes: + snowplow__entities_or_sdes: [ { - 'schema': 'com_snowplowanalytics_snowplow_ecommerce_transaction_1', - 'prefix': 'trans_entity', - 'alias': 'tr', + 'schema': 'com_snowplowanalytics_snowplow_ecommerce_transaction_1', + 'prefix': 'trans_entity', + 'alias': 'tr', 'single_entity': true }, { - 'schema': 'com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1', - 'prefix': 'trans_event', - 'alias': 'trev', + 'schema': 'com_snowplowanalytics_snowplow_ecommerce_snowplow_ecommerce_action_1', + 'prefix': 'trans_event', + 'alias': 'trev', 'single_entity': true } ] - snowplow__conversion_events: + snowplow__conversion_events: [ { - "name": "transact", - "condition": "event_name = 'snowplow_ecommerce_action' and trans_event_type = 'transaction'", + "name": "transact", + "condition": "event_name = 'snowplow_ecommerce_action' and trans_event_type = 'transaction'", "value":"trans_entity_revenue" } ] @@ -285,7 +285,7 @@ export const printYamlVariables = (data) => { snowplow__conversion_events: ${JSON.stringify(data, null, 4)}`} ) -} +}; export const darkTheme = createTheme({ palette: { @@ -299,7 +299,7 @@ export const lightTheme = createTheme({ }, }); -export function JsonSchemaGenerator({ output, children, schema }) { +export const JsonSchemaGenerator = ({ output, children, schema }) => { const [formData, setFormData] = useState(null) const { colorMode, setColorMode } = useColorMode() return ( diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/core-web-vitals-module/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/core-web-vitals-module/index.md index 8bb7a727ea..88c87250d3 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/core-web-vitals-module/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-unified-data-model/core-web-vitals-module/index.md @@ -7,6 +7,7 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` + ```mdx-code-block @@ -16,7 +17,7 @@ import { Accelerator } from "@site/src/components/AcceleratorAdmonitions"; ``` ```mdx-code-block -import CoreWebVitals from "@site/docs/reusable/data-modeling/core-web-vitals/_index.md" +import CoreWebVitals from "@site/docs/reusable/data-modeling/core-web-vitals/_index.md"; ``` diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-utils-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-utils-data-model/index.md index 2ab6bf5199..13e8966a89 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-utils-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/dbt-utils-data-model/index.md @@ -9,6 +9,7 @@ hide_title: true import Badges from '@site/src/components/Badges'; import ThemedImage from '@theme/ThemedImage'; ``` +     diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-mobile-data-model/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-mobile-data-model/index.md index 8a1e69f6e9..95ac5b9c9b 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-mobile-data-model/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-mobile-data-model/index.md @@ -12,6 +12,7 @@ import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import {versions} from '@site/src/componentVersions'; ``` +     diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/consent-module/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/consent-module/index.md index cc98c84063..1631745b06 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/consent-module/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/consent-module/index.md @@ -7,10 +7,11 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` + ```mdx-code-block -import Consent from "@site/docs/reusable/data-modeling/consent/_index.md" +import Consent from "@site/docs/reusable/data-modeling/consent/_index.md"; +``` -``` diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/core-web-vitals-module/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/core-web-vitals-module/index.md index 49f3836f32..764bd1c6fb 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/core-web-vitals-module/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/legacy/dbt-web-data-model/core-web-vitals-module/index.md @@ -7,6 +7,7 @@ hide_title: true ```mdx-code-block import Badges from '@site/src/components/Badges'; ``` + ```mdx-code-block diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/index.md index 11927c1c52..daeda69571 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-operation/full-or-partial-refreshes/index.md @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'; ## Complete refresh of Snowplow package -While you can drop and recompute the incremental tables within this package using the standard `--full-refresh` flag, all [manifest tables](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/manifest-tables/index.md) are protected from being dropped in production (as defined by a target not matching your `snowplow__dev_target_name`). +While you can drop and recompute the incremental tables within this package using the standard `--full-refresh` flag, all [manifest tables](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/manifest-tables/index.md) are protected from being dropped in production (as defined by a target not matching your `snowplow__dev_target_name`). Without dropping the manifest during a full refresh, the selected derived incremental tables would be dropped but the processing of events would resume from where the package left off, as captured by the `snowplow__incremental_manifest` table, rather than your `snowplow__start_date`. @@ -53,7 +53,7 @@ You may at times wish to refresh only some derived models in a package, either a ``` 2. *(High Risk)* manually deleting the record from the `snowplow__incremental_manifest` table. -By removing the model from the manifest the will be in [State 2](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/incremental-processing/index.md#state-2-new-model-introduced) and will replay all events. +By removing the model from the manifest the `` will be in [State 2](/docs/modeling-your-data/modeling-your-data-with-dbt/package-mechanics/incremental-processing/index.md#state-2-new-model-introduced) and will replay all events. ## Custom period re-processing @@ -73,10 +73,10 @@ As defined in the [standard run incremental logic](/docs/modeling-your-data/mode For example, if your last run success was `2022-10-30 13:00:00` and you needed to reprocess events from `2022-10-25 02:00:00`, you would set your `snowplow__lookback_window_hours` to `137` (5 days × 24 hours + 11 hours, and 6 hours of an additional buffer the look back window would usually provide). This will reprocess all the events in a single run, which may be larger than the value you have set in `snowplow__backfill_limit_days`. If you wish to avoid going over the backfill limit you have set, please use option 2. Don't forget to change your value back once the run has completed!

-

diff --git a/docs/modeling-your-data/modeling-your-data-with-dbt/migration-guides/web_to_unified/index.md b/docs/modeling-your-data/modeling-your-data-with-dbt/migration-guides/web_to_unified/index.md index 75b896e8ad..8bcb09037a 100644 --- a/docs/modeling-your-data/modeling-your-data-with-dbt/migration-guides/web_to_unified/index.md +++ b/docs/modeling-your-data/modeling-your-data-with-dbt/migration-guides/web_to_unified/index.md @@ -71,7 +71,7 @@ Once you decided you would like to go ahead with the upgrade process you will fi #### Step 2: Execute SQL scripts to create the new tables -You will then need to execute a list of sql scripts we provide below, which will first create the new tables based on your existing derived tables created by the web package, then make the changes (e.g. renaming, adding, dropping and updating columns wherever possible). The manifest tables will also be altered making sure that you will then have everything ready for a new run in the unified package as if nothing happened. +You will then need to execute a list of sql scripts we provide below, which will first create the new tables based on your existing derived tables created by the web package, then make the changes (e.g. renaming, adding, dropping and updating columns wherever possible). The manifest tables will also be altered making sure that you will then have everything ready for a new run in the unified package as if nothing happened. Execute the below sql scripts with your database IDE to create your new derived and manifest tables at once without having to reprocess your event data from scratch. Make sure to update `(your_schema)_derived` to match your derived schema name beforehand. Please also be aware you might need to adjust the data `varchar` data type to `string` depending on your warehouse (Bigquery, Databricks users mainly) or limit it to the maximum in case there are limitations (potentially Redshift). @@ -132,9 +132,9 @@ alter table (your_schema)_derived.snowplow_unified_views rename column useragen alter table (your_schema)_derived.snowplow_unified_views rename column useragent_version to ua__useragent_version; alter table (your_schema)_derived.snowplow_unified_views add column if not exists default_channel_group varchar(25); alter table (your_schema)_derived.snowplow_unified_views add column event_name varchar(1000); -update (your_schema)_derived.snowplow_unified_views +update (your_schema)_derived.snowplow_unified_views set event_name = 'page_view' -where 1=1; +where 1=1; alter table (your_schema)_derived.snowplow_unified_views add column os_type varchar(16777216); alter table (your_schema)_derived.snowplow_unified_views add column os_version varchar(16777216); alter table (your_schema)_derived.snowplow_unified_views add column session__previous_session_id varchar(36); @@ -202,38 +202,38 @@ alter table (your_schema)_derived.snowplow_unified_users drop column original_do alter table (your_schema)_derived.snowplow_unified_users rename column page_views to views; alter table (your_schema)_derived.snowplow_unified_users rename column referrer to page_referrer; alter table (your_schema)_derived.snowplow_unified_users add column on_mobile boolean; -update (your_schema)_derived.snowplow_unified_users +update (your_schema)_derived.snowplow_unified_users set on_mobile = false -where 1=1; +where 1=1; alter table (your_schema)_derived.snowplow_unified_users add column on_web boolean; -update (your_schema)_derived.snowplow_unified_users +update (your_schema)_derived.snowplow_unified_users set on_web = true -where 1=1; +where 1=1; alter table (your_schema)_derived.snowplow_unified_users add column screen_names_viewed number(30,0); alter table (your_schema)_derived.snowplow_unified_users add column sessions_duration_s number(30,0); alter table (your_schema)_derived.snowplow_unified_users add column active_days number(18,0); alter table (your_schema)_derived.snowplow_unified_users add column last_platform varchar(255); -update (your_schema)_derived.snowplow_unified_users +update (your_schema)_derived.snowplow_unified_users set last_platform = 'web' -where 1=1; +where 1=1; alter table (your_schema)_derived.snowplow_unified_users add column last_screen_resolution varchar(16777216); alter table (your_schema)_derived.snowplow_unified_users add column last_os_type varchar(16777216); alter table (your_schema)_derived.snowplow_unified_users add column last_os_version varchar(16777216); alter table (your_schema)_derived.snowplow_unified_users add column first_platform varchar(255); -update (your_schema)_derived.snowplow_unified_users +update (your_schema)_derived.snowplow_unified_users set first_platform = 'web' -where 1=1; +where 1=1; alter table (your_schema)_derived.snowplow_unified_users add column geo_latitude float; alter table (your_schema)_derived.snowplow_unified_users add column geo_longitude float; alter table (your_schema)_derived.snowplow_unified_users add column geo_timezone varchar(64); alter table (your_schema)_derived.snowplow_unified_users add column geo_zipcode varchar(15); alter table (your_schema)_derived.snowplow_unified_users add column if not exists stitched_user_id varchar(16777216); -update (your_schema)_snowplow_manifest.snowplow_unified_incremental_manifest +update (your_schema)_snowplow_manifest.snowplow_unified_incremental_manifest set model = replace(model, 'snowplow_web', 'snowplow_unified') -where 1=1; +where 1=1; -update (your_schema)_snowplow_manifest.snowplow_unified_incremental_manifest +update (your_schema)_snowplow_manifest.snowplow_unified_incremental_manifest set model = case when model = 'snowplow_unified_page_views_this_run' then 'snowplow_unified_views_this_run' when model = 'snowplow_unified_page_views' then 'snowplow_unified_views' else model end where 1=1; @@ -293,15 +293,15 @@ In case you changed any of the default variables in your web project, add them h - `snowplow__screen_summary_context`: com_snowplowanalytics_mobile_screen_summary_1 (Redshift only) **Variables with changed defaults:** -- `snowplow__session_identifiers`: [{"schema" : "atomic", "field" : "domain_sessionid"}] -- `snowplow__user_identifiers`: [{"schema": "atomic", "field" : "domain_userid"}] +- `snowplow__session_identifiers`: `[{"schema" : "atomic", "field" : "domain_sessionid"}]` +- `snowplow__user_identifiers`: `[{"schema": "atomic", "field" : "domain_userid"}]` to none `snowplow__databricks_catalog`: 'hive_metastore' #### Step 4: Verifying the new derived datasets -At this stage you could potentially run both packages simultaneously until you make sure you are happy to stop the old jobs that updated the web package. +At this stage you could potentially run both packages simultaneously until you make sure you are happy to stop the old jobs that updated the web package. We have also provided views which replicate the original derived tables to help you maintain your existing reporting (in case you use the original derived tables as a source for your BI tool or for downstream data models). @@ -310,7 +310,7 @@ We have also provided views which replicate the original derived tables to help ```sql create view (your_schema)_derived.mock_snowplow_web_page_views as ( - select + select view_id as page_view_id, event_id, app_id, @@ -420,9 +420,9 @@ create view (your_schema)_derived.mock_snowplow_web_page_views as ( yauaa__operating_system_version as operating_system_version, from (your_schema)_derived.snowplow_unified_views ); - + create view (your_schema)_derived.mock_snowplow_web_sessions as ( - select + select app_id, platform, session_identifier as domain_sessionid, @@ -538,7 +538,7 @@ create view (your_schema)_derived.mock_snowplow_web_sessions as ( ); create view (your_schema)_derived.mock_snowplow_web_users as ( - select + select user_id, user_identifier as domain_userid, null as original_domain_userid, @@ -595,7 +595,7 @@ create view (your_schema)_derived.mock_snowplow_web_users as ( mkt_network, mkt_source_platform, default_channel_group - from (your_schema)_derived.snowplow_unified_users + from (your_schema)_derived.snowplow_unified_users ); ```
diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/bigquery-loader/snowplow-bigquery-loader-configuration-reference/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/bigquery-loader/snowplow-bigquery-loader-configuration-reference/index.md index 54287daf6a..2189d0a482 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/bigquery-loader/snowplow-bigquery-loader-configuration-reference/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/bigquery-loader/snowplow-bigquery-loader-configuration-reference/index.md @@ -18,9 +18,9 @@ This is a complete list of the options that can be configured in the Snowplow Bi | `loader.output.types.topic` | Required. The name of the topic where observed types will be written, eg types-topic. | | `loader.output.failedInserts.topic` | Required. The name of the topic where failed inserts will be written, eg failed-inserts-topic. | | `mutator.input.subscription` | Required. A subscription on the loader.output.types.topic, eg types-sub. | -| `mutator.output.good.*` | Required. Equivalent to loader.output.good.*. Can be specified in detail or as ${loader.output.good}. | +| `mutator.output.good.*` | Required. Equivalent to loader.output.good.*. Can be specified in detail or as `${loader.output.good}`. | | `repeater.input.subscription` | Required. Failed inserts subscription consumed by Repeater. Must be attached to the loader.output.failedInserts.topic, eg failed-inserts-sub. | -| `repeater.output.good.*` | Required. Equivalent to loader.output.good.*. Can be specified in detail or as ${loader.output.good}. | +| `repeater.output.good.*` | Required. Equivalent to loader.output.good.*. Can be specified in detail or as `${loader.output.good}`. | | `repeater.output.deadLetters.bucket` | Required. Failed inserts that repeatedly fail to be inserted into BigQuery are stored on GCS in this bucket, eg gs://dead-letter-bucket. | | `monitoring.*` | Optional. See below for details.Note: This was a required setting in 1.0.0. Can be left blank, ie {}, to disable this functionality in that version. | @@ -29,11 +29,11 @@ This is a complete list of the options that can be configured in the Snowplow Bi | parameter | description | |-----------|-------------| | `monitoring.statsd.*` | Optional. If set up, metrics will be emitted from StreamLoader and Repeater using the [StatsD](https://github.com/statsd/statsd) protocol. | -| `monitoring.statsd.hostname` | Optional, eg statsd.acme.gl. | +| `monitoring.statsd.hostname` | Optional, eg `statsd.acme.gl`. | | `monitoring.statsd.port` | Optional, eg 1024. | -| `monitoring.statsd.tags` | Optional. You can use env vars, eg {"worker": ${HOST}}. | +| `monitoring.statsd.tags` | Optional. You can use env vars, eg `{"worker": ${HOST}}`. | | `monitoring.statsd.period` | Optional, eg 10 sec. | -| `monitoring.statsd.prefix` | Optional, eg snowplow.monitoring. | +| `monitoring.statsd.prefix` | Optional, eg `snowplow.monitoring`. | | `monitoring.stdout.*` | Optional. If set up, metrics will be logged to stdout at INFO level. | | `monitoring.sentry` | Optional. If set up, errors will be sent to a [Sentry](https://sentry.io/) endpoint. | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_delta_config.md b/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_delta_config.md index 8c58ea874f..49bb34a72e 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_delta_config.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_delta_config.md @@ -4,18 +4,20 @@ import Link from '@docusaurus/Link'; output.good.location - Required, e.g. gs://mybucket/events. URI of the bucket location to which to write Snowplow enriched events in Delta format. The URI should start with the following prefix: -
    -
  • s3a:// on AWS
  • -
  • gs:// on GCP
  • -
  • abfs:// on Azure
  • -
+ + Required, e.g. gs://mybucket/events. URI of the bucket location to which to write Snowplow enriched events in Delta format. The URI should start with the following prefix: +
    +
  • s3a:// on AWS
  • +
  • gs:// on GCP
  • +
  • abfs:// on Azure
  • +
output.good.deltaTableProperties.* - Optional. A map of key/value strings corresponding to Delta's table properties. - These can be anything from the Delta table properties documentation. - The default properties include configuring Delta's data skipping feature for the important Snowplow timestamp columns: load_tstamp, collector_tstamp, derived_tstamp, dvce_created_tstamp. + Optional. A map of key/value strings corresponding to Delta's table properties. + These can be anything from the Delta table properties documentation. + The default properties include configuring Delta's data skipping feature for the important Snowplow timestamp columns: load_tstamp, collector_tstamp, derived_tstamp, dvce_created_tstamp. + diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_hudi_config.md b/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_hudi_config.md index acc1dbd04b..125de69354 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_hudi_config.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/lake-loader/configuration-reference/_hudi_config.md @@ -1,11 +1,12 @@ output.good.location - Required, e.g. gs://mybucket/events. URI of the bucket location to which to write Snowplow enriched events in Hudi format. The URI should start with the following prefix: -
    -
  • s3a:// on AWS
  • -
  • gs:// on GCP
  • -
  • abfs:// on Azure
  • -
+ + Required, e.g. gs://mybucket/events. URI of the bucket location to which to write Snowplow enriched events in Hudi format. The URI should start with the following prefix: +
    +
  • s3a:// on AWS
  • +
  • gs:// on GCP
  • +
  • abfs:// on Azure
  • +
diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/s3-loader/configuration-reference/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/s3-loader/configuration-reference/index.md index cc28fd41ff..1f98156970 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/s3-loader/configuration-reference/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/s3-loader/configuration-reference/index.md @@ -26,7 +26,7 @@ This is a complete list of the options that can be configured in the S3 loader H | `buffer.byteLimit` | Required. Maximum bytes to read from kinesis before flushing a file to S3 | | `buffer.recordLimit` | Required. Maximum records to read from kinesis before flushing a file to S3 | | `buffer.timeLimit` | Required. Maximum time to wait in milliseconds between writing files to S3 | -| `monitoring.snowplow.collector` | Optional. E.g. . URI of a snowplow collector. Used for monitoring application lifecycle and failure events | +| `monitoring.snowplow.collector` | Optional. E.g. `https://snplow.acme.com`. URI of a snowplow collector. Used for monitoring application lifecycle and failure events | | `monitoring.snowplow.appId` | Required only if the collector uri is also configured. Sets the appId field of the snowplow events | | `monitoring.sentry.dsn` | Optional, for tracking uncaught run time exceptions | | `monitoring.metrics.cloudwatch` | Optional boolean, with default true. This is used to disable sending metrics to cloudwatch | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/index.md index 904791920d..a42ea9dc7d 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/index.md @@ -176,7 +176,7 @@ Only Snowflake Loader can be run on Azure at the moment. | Parameter | Description | |----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `monitoring.webhook.endpoint` | Optional. An HTTP endpoint where monitoring alerts should be sent. | -| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, {"tag1": "label1"}. | +| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, `{"tag1": "label1"}`. | | `monitoring.snowplow.appId` | Optional. When using Snowplow tracking, set this `appId` in the event. | | `monitoring.snowplow.collector` | Optional. Set to a collector URL to turn on Snowplow tracking. | | `monitoring.sentry.dsn` | Optional. For tracking runtime exceptions. | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-3-0-x/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-3-0-x/index.md index ea14a9a223..38aaf600d0 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-3-0-x/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-3-0-x/index.md @@ -90,7 +90,7 @@ This is a complete list of the options that can be configured: | | | |----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `monitoring.webhook.endpoint` | Optional. An HTTP endpoint where monitoring alerts should be sent. | -| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, {"tag1": "label1"}. | +| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, `{"tag1": "label1"}`. | | `monitoring.snowplow.appId` | Optional. When using Snowplow tracking, set this `appId` in the event. | | `monitoring.snowplow.collector` | Optional. Set to a collector URL to turn on Snowplow tracking. | | `monitoring.sentry.dsn` | Optional. For tracking runtime exceptions. | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-4-0-x/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-4-0-x/index.md index a96d8cae95..2b1381a18b 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-4-0-x/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/loading-transformed-data/rdb-loader-configuration-reference/rdb-loader-previous-versions/rdb-loader-4-0-x/index.md @@ -118,7 +118,7 @@ This is a complete list of the options that can be configured: | Parameter | Description | |----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `monitoring.webhook.endpoint` | Optional. An HTTP endpoint where monitoring alerts should be sent. | -| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, {"tag1": "label1"}. | +| `monitoring.webhook.tags` | Optional. Custom key-value pairs which can be added to the monitoring webhooks. Eg, `{"tag1": "label1"}`. | | `monitoring.snowplow.appId` | Optional. When using Snowplow tracking, set this `appId` in the event. | | `monitoring.snowplow.collector` | Optional. Set to a collector URL to turn on Snowplow tracking. | | `monitoring.sentry.dsn` | Optional. For tracking runtime exceptions. | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/previous-versions/snowplow-rdb-loader/configuration-reference/index.md b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/previous-versions/snowplow-rdb-loader/configuration-reference/index.md index c90f6efdd0..357abf0c68 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/previous-versions/snowplow-rdb-loader/configuration-reference/index.md +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/previous-versions/snowplow-rdb-loader/configuration-reference/index.md @@ -33,13 +33,13 @@ This is a complete list of the options that can be configured | storage.jdbc.tcpKeepAliveMinutes | Optional. Refer to the Redshift JDBC driver reference. | | storage.maxError | Optional. Configures the Redshift MAXERROR load option. Default value 10. | | monitoring.webhook.endpoint | Optional. An http endpoint where monitoring alerts should be sent. | -| monitoring.webhook.tags | Optional. Custom key-value pairs which can be added to the monitoring webhooks. E.g. {"tag1": "label1"} | +| monitoring.webhook.tags | Optional. Custom key-value pairs which can be added to the monitoring webhooks. E.g. `{"tag1": "label1"} ` | | monitoring.snowplow.appId | Optional. When using Snowplow tracking, set this appId in the event. | | monitoring.snowplow.collector | Optional. Set to a collector url to turn on snowplow tracking. | | monitoring.sentry.dsn | Optional. For tracking runtime exceptions. | | monitoring.statsd.hostname | Optional, for sending loading metrics (latency and event counts) to a statsd server. | | monitoring.statsd.port | Optional, port of the statsd server. | -| monitoring.statsd.tags | E.g. { "key1": "value1", "key2": "value2" }. Tags are used to annotate the statsd metric with any contextual information. | +| monitoring.statsd.tags | E.g. `{ "key1": "value1", "key2": "value2" }`. Tags are used to annotate the statsd metric with any contextual information. | | monitoring.statsd.prefix | Optional, default “snoplow.rdbloader”. Configures the prefix of statsd metric names. | | monitoring.folders.staging | Required if folder monitoring section included in the config. Configuration for periodic unloaded/corrupted folders checks. Path where Loader could store auxiliary logs. Loader should be able to write here, Redshift should be able to load from here | | monitoring.folders.period | Required if folder monitoring section included in the config. How often to check for unloaded/corrupted folders. | diff --git a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/transforming-enriched-data/reusable/batch-only/_index.mdx b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/transforming-enriched-data/reusable/batch-only/_index.mdx index 6483e9f15b..f3f0726a79 100644 --- a/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/transforming-enriched-data/reusable/batch-only/_index.mdx +++ b/docs/pipeline-components-and-applications/loaders-storage-targets/snowplow-rdb-loader/transforming-enriched-data/reusable/batch-only/_index.mdx @@ -32,7 +32,9 @@ monitoring.metrics.cloudwatch.dimensions (since 5.5.0) - Any key-value pairs to be added as dimensions in Cloudwatch metrics. Example: + + +Any key-value pairs to be added as dimensions in Cloudwatch metrics. Example: ```json {"app_version": "x.y.z", "env": "prod"} diff --git a/docs/pipeline-components-and-applications/stream-collector/setup/index.md b/docs/pipeline-components-and-applications/stream-collector/setup/index.md index d2ffde1e52..b9f5520923 100644 --- a/docs/pipeline-components-and-applications/stream-collector/setup/index.md +++ b/docs/pipeline-components-and-applications/stream-collector/setup/index.md @@ -8,6 +8,7 @@ sidebar_position: 1 import {versions} from '@site/src/componentVersions'; import CodeBlock from '@theme/CodeBlock'; ``` + ## Available on Terraform Registry [![](https://img.shields.io/static/v1?label=Terraform&message=Registry&color=7B42BC&logo=terraform)](https://registry.terraform.io/modules/snowplow-devops/collector-kinesis-ec2/aws/latest) diff --git a/docs/reusable/data-modeling/core-web-vitals/_index.md b/docs/reusable/data-modeling/core-web-vitals/_index.md index a9bd19729d..379a5afdc6 100644 --- a/docs/reusable/data-modeling/core-web-vitals/_index.md +++ b/docs/reusable/data-modeling/core-web-vitals/_index.md @@ -2,6 +2,7 @@ import ReactMarkdown from 'react-markdown'; import CodeBlock from '@theme/CodeBlock'; ``` + # Core Web Vitals Custom Module @@ -55,7 +56,7 @@ For information about overriding our macros, see [here](/docs/modeling-your-data Please make sure you set the results you would like the measurements to pass to **`good`** or align it with the `macro_core_web_vital_pass_query()` macro. -- The `core_web_vital_pass_query()` (source) +- The `core_web_vital_pass_query()` (source) ```sql case when lcp_result = 'good' and fid_result = 'good' and cls_result = 'good' then 1 else 0 end passed diff --git a/docs/reusable/javascript-tracker-cross-domain/_index.md b/docs/reusable/javascript-tracker-cross-domain/_index.md index 9e70741ba1..efb304edec 100644 --- a/docs/reusable/javascript-tracker-cross-domain/_index.md +++ b/docs/reusable/javascript-tracker-cross-domain/_index.md @@ -39,46 +39,36 @@ If you want to decorate every link, regardless of its destination: Note that the above will decorate “links” which are actually just JavaScript actions (with an `href` of `"javascript:void(0)"`), or links to email addresses or telephone numbers ([`mailto:`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_email_address) or [`tel:`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_telephone_numbers) schemes). To exclude these links, check them explicitly: -<>{ props.lang === "browser" && <> +```mdx-code-block +import CodeBlock from '@theme/CodeBlock'; +``` -```javascript -crossDomainLinker(function(linkElement) { +<>{(props.lang === "browser") && { +`crossDomainLinker(function(linkElement) { return linkElement.href.indexOf('javascript:') < 0; -}); -``` - -} -<>{ props.lang === "javascript" && <> +});` +}} -```javascript -snowplow('crossDomainLinker', function(linkElement) { +<>{(props.lang === "javascript") && { +`snowplow('crossDomainLinker', function(linkElement) { return linkElement.href.indexOf('javascript:') < 0; -}); -``` - -} +});` +}} Alternatively, only count links that parse as web URLs by checking the link's [`hostname`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/hostname). This should automatically exclude links that don't lead simply to other web pages. -<>{ props.lang === "browser" && <> - -```javascript -crossDomainLinker(function(linkElement) { +<>{(props.lang === "browser") && { +`crossDomainLinker(function(linkElement) { return linkElement.hostname !== ""; -}); -``` - -} -<>{ props.lang === "javascript" && <> +});` +}} -```javascript -snowplow('crossDomainLinker', function(linkElement) { +<>{(props.lang === "javascript") && { +`snowplow('crossDomainLinker', function(linkElement) { return linkElement.hostname !== ""; -}); -``` - -} +});` +}} :::note Opt-in vs opt-out @@ -117,24 +107,17 @@ This ensures that the timestamp added to the querystring is fresh. If further links get added to the page after the tracker has loaded, you can use the tracker’s `crossDomainLinker` method to add listeners again. (Listeners won’t be added to links which already have them.) -<>{ props.lang === "browser" && <> - -```javascript -crossDomainLinker(function (linkElement) { +<>{(props.lang === "browser") && { +`crossDomainLinker(function (linkElement) { return (linkElement.href === 'http://acme.de' || linkElement.id === 'crossDomainLink'); -}); -``` - -} -<>{ props.lang === "javascript" && <> +});` +}} -```javascript -snowplow('crossDomainLinker', function (linkElement) { +<>{(props.lang === "javascript") && { +`snowplow('crossDomainLinker', function (linkElement) { return (linkElement.href === 'http://acme.de' || linkElement.id === 'crossDomainLink'); -}); -``` - -} +});` +}} :::caution Warning @@ -153,29 +136,28 @@ This means after the next page is tracked, if the user copies the URL after the You can do this using the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState). -<>{ props.lang === "browser" && <> - -```javascript -trackPageView(); // page URL is https://example.com/?example=123&_sp=6de9024e-17b9-4026-bd4d-efec50ae84cb.1680681134458 +<>{(props.lang === "browser") && { +`trackPageView(); // page URL is https://example.com/?example=123&_sp=6de9024e-17b9-4026-bd4d-efec50ae84cb.1680681134458 if (/[?&]_sp=/.test(window.location.href)) { history.replaceState(history.state, "", window.location.replace(/&?_sp=[^&]+/, "")); // page URL is now https://example.com/?example=123 -} +}` +}} + +```mdx-code-block +import ReactMarkdown from 'react-markdown'; ``` - -} -<>{ props.lang === "javascript" && <> -The URL updating code runs in a [Tracker Callback](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/#getting-user-id-once-set) to ensure it does not run before the page view event has a chance to capture the original URL. -```javascript -snowplow('trackPageView'); // page URL is https://example.com/?example=123&_sp=6de9024e-17b9-4026-bd4d-efec50ae84cb.1680681134458 +<>{(props.lang === "javascript") && <>{` +The URL updating code runs in a [Tracker Callback](/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/index.md#getting-user-id-once-set) to ensure it does not run before the page view event has a chance to capture the original URL.`} +{ +`snowplow('trackPageView'); // page URL is https://example.com/?example=123&_sp=6de9024e-17b9-4026-bd4d-efec50ae84cb.1680681134458 snowplow(function(){ if (/[?&]_sp=/.test(window.location.href)) { history.replaceState(history.state, "", window.location.replace(/&?_sp=[^&]+/, "")); // page URL is now https://example.com/?example=123 } -}); -``` - -} +});` +} +} This approach can work with other parameters (e.g. `utm_source`) but it is not recommended unless you are sure other systems have also already captured the parameter values for their own systems. Some systems may consider the URL update a single page application page change, and automatically fire additional page view events with this implementation, we suggest careful testing of this technique to ensure compatibility with your existing vendors. diff --git a/docs/reusable/javascript-tracker-retrieve-values/_browser.md b/docs/reusable/javascript-tracker-retrieve-values/_browser.md new file mode 100644 index 0000000000..98c773529a --- /dev/null +++ b/docs/reusable/javascript-tracker-retrieve-values/_browser.md @@ -0,0 +1,11 @@ +When initialising a tracker, you can use the returned `tracker` instance to access various properties from this tracker instance. + +```javascript +// Configure a tracker instance named "sp" +const sp = newTracker('sp', '{{COLLECTOR_URL}', { + appId: 'snowplowExampleApp' +}); + +// Access the tracker properties +const domainUserId = sp.getDomainUserId(); +``` diff --git a/docs/reusable/javascript-tracker-retrieve-values/_index.md b/docs/reusable/javascript-tracker-retrieve-values/_javascript.md similarity index 75% rename from docs/reusable/javascript-tracker-retrieve-values/_index.md rename to docs/reusable/javascript-tracker-retrieve-values/_javascript.md index 14b2e338db..e100587191 100644 --- a/docs/reusable/javascript-tracker-retrieve-values/_index.md +++ b/docs/reusable/javascript-tracker-retrieve-values/_javascript.md @@ -1,5 +1,3 @@ -<>{ props.lang === "javascript" && <> - If you call `snowplow` with a function as the argument, the function will be executed when sp.js loads: ```javascript @@ -48,22 +46,3 @@ snowplow(console.log.bind(console), "sp.js has loaded"); ``` For more on execution context in JavaScript, see the [MDN page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this). - - -} -<>{ props.lang === "browser" && <> - -When initialising a tracker, you can use the returned `tracker` instance to access various properties from this tracker instance. - -```javascript -// Configure a tracker instance named "sp" -const sp = newTracker('sp', '{{COLLECTOR_URL}', { - appId: 'snowplowExampleApp' -}); - -// Access the tracker properties -const domainUserId = sp.getDomainUserId(); -``` - - -} diff --git a/docs/reusable/schema-properties/_index.md b/docs/reusable/schema-properties/_index.md index 7eeae6cfc8..1cd6cc46b1 100644 --- a/docs/reusable/schema-properties/_index.md +++ b/docs/reusable/schema-properties/_index.md @@ -9,8 +9,9 @@ import EventQuery from "@site/docs/reusable/event-query/_index.md"

{props.info || props.schema.description}

- Schema URI: - iglu://{props.schema.self.vendor}/{props.schema.self.name}/{props.schema.self.format}/{props.schema.self.version} + Schema URI: + + iglu://{props.schema.self.vendor}/{props.schema.self.name}/{props.schema.self.format}/{props.schema.self.version}

{ diff --git a/docs/reusable/telemetry/_index.md b/docs/reusable/telemetry/_index.md index 02fe78aca1..02b2a1fbaa 100644 --- a/docs/reusable/telemetry/_index.md +++ b/docs/reusable/telemetry/_index.md @@ -1,4 +1,5 @@ -
Telemetry notice +
+Telemetry notice

By default, Snowplow collects telemetry data for {props.name}{props.since && ` (since version ${props.since})`}. Telemetry allows us to understand how our applications are used and helps us build a better product for our users (including you!).