You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/website/javascript/index.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -838,10 +838,11 @@ So, for example, if somebody follows the link with above query string to your si
838
838
839
839
Whenever the UTM parameters are no longer a part of the URL, Segment no longer includes them. For example, if the user goes to a new page within your website which does not contain these parameters, they will not be included in subsequent events. UTM parameters are non-persistent by default as they could potentially cause data accuracy problems. Here's an example of why: Say a user clicks on an ad and lands on your site. He navigates around and bookmarks an internal page - or maybe shares a link with a friend, who shares it with another friend. All those links would then point back to the same test utm_source as the initial referrer for any purchase.
840
840
841
-
**Additional Note**:
842
-
Segment does not validate UTM parameter names. This design supports the flexibility to track both standard parameters (e.g., utm_source, utm_medium) and custom parameters defined by users. As a result, all parameters present in the URL are collected as-is and added to the context field, without checks for naming conventions or validity.
841
+
Segment doesn't validate UTM parameter names. This design supports the flexibility to track both standard parameters (for example, utm_source, utm_medium) and custom parameters defined by users. As a result, all parameters present in the URL collected as is, and are added to the context field without checks for naming conventions or validity.
843
842
844
-
If you want to ensure that only standard UTM parameters (e.g., utm_source, utm_medium, utm_campaign, utm_content, utm_term) are included in the context.campaign object, you can implement [Source middleware](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/middleware/) in your analytics.js setup. Here’s an example:
843
+
If you want to ensure that only standard UTM parameters (such as, utm_source, utm_medium, utm_campaign, utm_content, utm_term) are included in the context.campaign object, you can implement [Source middleware](/docs/connections/sources/catalog/libraries/website/javascript/middleware/) in your Analytics.js setup.
844
+
845
+
For example:
845
846
846
847
```js
847
848
window.analytics.addSourceMiddleware(({ payload, next }) => {
@@ -857,7 +858,7 @@ window.analytics.addSourceMiddleware(({ payload, next }) => {
857
858
next(payload);
858
859
});
859
860
```
860
-
This middleware will filter out any non-standard parameters from the context.campaign object before they are sent to Segment or forwarded to your enabled destinations.
861
+
This middleware filters out any non-standard parameters from the `context.campaign` object before they're sent to Segment or forwarded to your enabled destinations.
0 commit comments