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/troubleshooting.md
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ Segment correctly sets cookies with the 'SameSite' attribute with Analytics.js.
113
113
If you see this warning, it is because you previously visited http://segment.com, and are getting the warning due to unrelated cookies. To verify that this is the issue, visit your page in Incognito Mode and confirm that the warning no longer occurs. Your users won't see this warning unless they _also_ visited http://segment.com.
114
114
115
115
116
-
###Can I overwrite the context fields?
116
+
## Can I overwrite the context fields?
117
117
118
118
Yes. This can be useful if some of these fields contain information you don't want to collect.
###What is the impact of exposing the source's write keys?
146
+
## What is the impact of exposing the source's write keys?
147
147
148
148
For the Segment script to work in the browser, you need to expose the write key in order for client-side tracking to work. Segment's library architecture requires the write key to be exposed, similar to that of other major tools like Google Analytics, Mixpanel, Kissmetrics, Hubspot, and Marketo.
149
149
150
150
If you see any unusual behavior associated with your write key, you can generate a new key. Navigate to **Connections > Sources** and select your source. On the **Settings** tab, go to the **API Keys** section, and click **Generate New Key**.
151
151
152
152
If you want to hide the write key, you can use Segment's [HTTP Tracking API source](/docs/connections/sources/catalog/libraries/server/http-api/) or one of the other [server-side libraries](/docs/connections/sources/catalog/#server).
153
153
154
-
###Can I add context fields that do not already exist?
154
+
## Can I add context fields that do not already exist?
155
155
156
156
Yes. Similar to overwriting context, you can add context fields by passing them into the options object as the third argument of the event call. For example, the analytics.js library does not automatically collect location information. To add this into the context object, pass it into the third argument as in the example below:
Some destinations accept properties only. As a result, custom context fields you add may not forward to these destinations.
171
171
172
-
###Why am I seeing additional cookies on my website?
172
+
## Why am I seeing additional cookies on my website?
173
173
174
174
The AJS cookies being set under segment.com are first-party cookies. They are part of Segment's own implementation as well as the destination Segment uses. These cookies are not related to your implementation of Segment, and you only see them because you've visited Segment's domain using the same browser. They are sent to the writekey connected to Segment's own workspace, and are associated with the events Segment tracks when you visit segment.com.
175
175
176
+
## How is the referrer value set?
177
+
178
+
The Analytics.js library sets the `context.page.referrer` value from the `window.document.referrer`[property](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer){:target="_blank"} set in the browser. If you notice unexpected referrer values reaching Segment, check how this value is being set on your website.
0 commit comments