Skip to content

Commit 5bb1cde

Browse files
authored
Merge pull request #2240 from segmentio/pagespec_updates
Segment Spec Page updates
2 parents 0c75151 + 1d0835b commit 5bb1cde

File tree

1 file changed

+14
-71
lines changed

1 file changed

+14
-71
lines changed

src/connections/spec/page.md

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Spec: Page'
33
---
44

5-
The `page` call lets you record whenever a user sees a page of your website, along with any optional properties about the page. Calling `page` or [`screen`](/docs/connections/spec/screen/) in one of our [sources](/docs/connections/sources/) is one of the first steps to getting started with Segment.
5+
The `page` call lets you record whenever a user sees a page of your website, along with any optional properties about the page. Calling `page` or [`screen`](/docs/connections/spec/screen/) in a Segment [source](/docs/connections/sources/) is one of the first steps to getting started with Segment.
66

77
{% include components/reference-button.html href="https://university.segment.com/introduction-to-segment/299969?reg=1&referrer=docs" icon="media/academy.svg" title="Segment University: The Page Method" description="Check out our high-level overview of the Page method in Segment University. (Must be logged in to access.)" %}
88

@@ -21,7 +21,7 @@ Here's the payload of a typical `page` call with most [common fields](/docs/conn
2121
}
2222
```
2323

24-
And here's the corresponding Javascript event that would generate the above payload. If you're using Segment's Javascript library, the page name and URL are automatically gathered and passed as properties into the event payload:
24+
And here's the corresponding JavaScript event that would generate the above payload. If you're using Segment's JavaScript library, the page name and URL are automatically gathered and passed as properties into the event payload:
2525

2626
```js
2727
analytics.page("Retail Page","Home");
@@ -77,77 +77,20 @@ Here's a complete example of a `page` call:
7777

7878
Properties are extra pieces of information that describe the page. They can be anything you want.
7979

80-
We've reserved some properties that have semantic meanings, and we handle them in special ways. For example, we always expect `path` to be the URL path of a page, and `referrer` to be the URL of the previous page.
80+
Segment handles properties with semantic meanings in unique ways. For example, Segment always expects `path` to be a page's URL path, and `referrer` to be the previous page's URL.
8181

8282
You should **only use reserved properties for their intended meaning**.
8383

84-
Reserved properties we have standardized:
84+
Reserved properties Segment has standardized:
8585

86-
<table>
87-
<tr>
88-
<td>**Property**</td>
89-
<td>**Type**</td>
90-
<td>**Description**</td>
91-
</tr>
92-
<tr>
93-
<td>`name`</td>
94-
<td>String</td>
95-
<td>Name of the page.
96-
97-
This is reserved for future use.
98-
99-
</td>
100-
</tr>
101-
<tr>
102-
<td>`path`</td>
103-
<td>String</td>
104-
<td>Path portion of the URL of the page.
105-
106-
107-
Equivalent to [`canonical path`](https://github.com/segmentio/analytics.js/blob/master/analytics.js#L6499-L6503) which defaults to [`location.pathname`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API.
108-
</td>
109-
</tr>
110-
<tr>
111-
<td>`referrer` </td>
112-
<td>String</td>
113-
<td>Full URL of the previous page.
114-
115-
116-
Equivalent to [`document.referrer`](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) from the DOM API.</td>
117-
</tr>
118-
<tr>
119-
<td>`search`</td>
120-
<td>String</td>
121-
<td>Query string portion of the URL of the page.
122-
123-
124-
Equivalent to [`location.search`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API.</td>
125-
</tr>
126-
<tr>
127-
<td>`title`</td>
128-
<td>String</td>
129-
<td>Title of the page.
130-
131-
132-
Equivalent to [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) from the DOM API.</td>
133-
</tr>
134-
<tr>
135-
<td>`url`</td>
136-
<td>String</td>
137-
<td>Full URL of the page.
138-
139-
140-
First we look for the canonical url. If the canonical url is not provided, we use [`location.href`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API.</td>
141-
</tr>
142-
<tr>
143-
<td>`keywords`</td>
144-
<td>Array[String]</td>
145-
<td>A list/array of keywords describing the content of the page.
146-
147-
148-
The keywords would most likely be the same as, or similar to, the keywords you would find in an html [meta](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#Attributes) tag for SEO purposes. This property is mainly used by content publishers that rely heavily on pageview tracking. This is not automatically collected.
149-
</td>
150-
</tr>
151-
</table>
86+
| Property | Type | Description |
87+
| ---------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
88+
| `name` | String | Name of the page. Reserved for future use. |
89+
| `path` | String | Path portion of the page's URL. Equivalent to [`canonical path`](https://github.com/segmentio/analytics.js/blob/master/analytics.js#L6499-L6503) which defaults to [`location.pathname`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API. |
90+
| `referrer` | String | Previous page's full URL. Equivalent to [`document.referrer`](https://developer.mozilla.org/en-US/docs/Web/API/Document/referrer) from the DOM API. |
91+
| `search` | String | Query string portion of the page's URL. Equivalent to [`location.search`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API. |
92+
| `title` | String | Page's title. Equivalent to [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) from the DOM API. |
93+
| `url` | String | Page's full URL. Segment first looks for the canonical URL. If the canonical URL is not provided, Segment uses [`location.href`](https://developer.mozilla.org/en-US/docs/Web/API/Location) from the DOM API. |
94+
| `keywords` | Array [String] | A list/array of keywords describing the page's content. The keywords would most likely be the same as, or similar to, the keywords you would find in an HTML [meta](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#Attributes) tag for SEO purposes. This property is mainly used by content publishers that rely heavily on pageview tracking. This is not automatically collected. |
15295

153-
**Note:** In [analytics.js](/docs/connections/sources/catalog/libraries/website/javascript/), we automatically send the following properties: `title`, `path`, `url`, `referrer`, and `search`.
96+
**Note:** In [analytics.js](/docs/connections/sources/catalog/libraries/website/javascript/), Segment automatically sends the following properties: `title`, `path`, `url`, `referrer`, and `search`.

0 commit comments

Comments
 (0)