Skip to content

Commit 2bd25d0

Browse files
authored
Merge pull request #5772 from segmentio/niall/referrer
Add referrer debug info info
2 parents d95a603 + 2b10ce3 commit 2bd25d0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/connections/sources/catalog/libraries/website/javascript/troubleshooting.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Segment correctly sets cookies with the 'SameSite' attribute with Analytics.js.
113113
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.
114114

115115

116-
### Can I overwrite the context fields?
116+
## Can I overwrite the context fields?
117117

118118
Yes. This can be useful if some of these fields contain information you don't want to collect.
119119

@@ -143,15 +143,15 @@ analytics.page("Receipt Page", {
143143
```
144144

145145

146-
### What is the impact of exposing the source's write keys?
146+
## What is the impact of exposing the source's write keys?
147147

148148
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.
149149

150150
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**.
151151

152152
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).
153153

154-
### Can I add context fields that do not already exist?
154+
## Can I add context fields that do not already exist?
155155

156156
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:
157157

@@ -169,10 +169,13 @@ analytics.track("Order Completed", {}, {
169169
170170
Some destinations accept properties only. As a result, custom context fields you add may not forward to these destinations.
171171

172-
### Why am I seeing additional cookies on my website?
172+
## Why am I seeing additional cookies on my website?
173173

174174
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.
175175

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.
176179

177180
## Known issues:
178181

0 commit comments

Comments
 (0)