Skip to content

Commit 4ef34db

Browse files
author
markzegarelli
authored
Clarify to remove GTM snippet (#2720)
1 parent 438dabb commit 4ef34db

File tree

1 file changed

+10
-11
lines changed
  • src/connections/destinations/catalog/google-tag-manager

1 file changed

+10
-11
lines changed

src/connections/destinations/catalog/google-tag-manager/index.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,37 @@ id: 54521fd625e721e32a72eeb9
99

1010
## Getting Started
1111

12-
{% include content/connection-modes.md %}
1312

1413
1. From the Segment web app, click **Catalog**.
1514
2. Search for "Google Tag Manager" in the Catalog, select it, and choose which of your sources to connect the destination to.
1615
3. In your Segment UI's destination settings, enter your Container ID (note: it should start with "GTM-"). You can find this in the Admin section of your [GTM dashboard](https://tagmanager.google.com/#/admin/).
17-
4. GTM will be loaded on any pages where your Segment snippet is initialized and `analytics.page` gets called in client-side Javascript. Once you've turned on GTM through Segment, you can use Segment `track` events to populate the GTM `dataLayer`.
16+
4. GTM loads on any pages where your Segment snippet is initialized and `analytics.page` is called in client-side Javascript. Once you've turned on GTM through Segment, you can use Segment `track` events to populate the GTM `dataLayer`, and remove the GTML snippet from your page.
1817

1918
**Notes**
20-
* We recommend loading GTM through Segment rather than loading Segment inside of GTM.
19+
* Segment recommends that you load GTM through Segment rather than loading Segment inside of GTM.
2120
* Be sure to "publish" your GTM container in GTM before trying to load it through Segment, otherwise your container URL will return a 404 error.
2221

2322

2423
## Page
2524
If you're not familiar with the Segment Specs, take a look to understand what the [Page method](/docs/connections/spec/page/) does. An example call would look like:
2625

2726
```js
28-
analytics.page('Home', {
27+
analytics.page('Home', {
2928
title: 'Welcome | My Website',
3029
url: 'https://mywebsite.com/'
3130
});
3231
```
3332

34-
You must call the Page method for Google Tag Manager to load. We already include a call to `analytics.page` in your default Segment snippet, so if you haven't removed that, GTM will work the same as if you installed the GTM snippet directly.
33+
You must call the Page method for Google Tag Manager to load. Segment includes a call to `analytics.page` in your default Segment snippet, so if you haven't removed that, GTM will work the same as if you installed the GTM snippet directly.
3534

3635
### Tracking All Pages
37-
When you turn on the setting to **Track All Pages** in your Optional Settings, we will track events whenever you call our `page` method and send a "Loaded A Page" event to Google Tag Manager. See the `track` section below for more info on how we send events to GTM.
36+
When you turn on the setting to **Track All Pages** in your Optional Settings, Segment tracks events whenever you call the `page` method and send a "Loaded A Page" event to Google Tag Manager. See the `track` section below for more info on how Segment sends events to GTM.
3837

3938
### Named Page Events
40-
If you include a `name` parameter in your `page` calls and turn on the setting to **Track Named Pages** in your Optional Settings, we will also pass on an event to GTM for that page. For example, `analytics.page('Signup')` would translate to a "Viewed Signup Page" event. See the `track` section below for more info on how we send events to GTM.
39+
If you include a `name` parameter in your `page` calls and turn on the setting to **Track Named Pages** in your Optional Settings, Segment passes on an event to GTM for that page. For example, `analytics.page('Sign up')` would translate to a "Viewed Sign up Page" event. See the `track` section below for more info about how Segment sends events to GTM.
4140

4241
### Categorized Page Events
43-
If you include a `category` parameter in your `page` calls and turn on the setting to **Track Categorized Pages** in your Optional Settings, we will also pass on an event to GTM for that page. For example, `analytics.page('Docs', 'Index')` would translate to a "Viewed Docs Index Page" event. See the `track` section below for more info on how we send events to GTM.
42+
If you include a `category` parameter in your `page` calls and turn on the setting to **Track Categorized Pages** in your Optional Settings, Segment passes an event to GTM for that page. For example, `analytics.page('Docs', 'Index')` would translate to a "Viewed Docs Index Page" event. See the `track` section below for more info about how Segment sends events to GTM.
4443

4544

4645
## Track
@@ -54,7 +53,7 @@ analytics.track('Article Completed', {
5453
});
5554
```
5655

57-
When you make a Track call in with GTM enabled through Segment, we will push the event data to the GTM `dataLayer`.
56+
When you make a Track call in with GTM enabled through Segment, the event data is pushed to the GTM `dataLayer`.
5857

5958
For example, if you make this `track` call:
6059

@@ -65,7 +64,7 @@ analytics.track('Played Video', {
6564
})
6665
```
6766

68-
We will pass it to the `dataLayer` as an object like this:
67+
Segment it to the `dataLayer` as an object like this:
6968

7069
```json
7170
{
@@ -86,7 +85,7 @@ If you are seeing `404` error on the javascript console of your page and it is a
8685
## Appendices
8786

8887
### UserId and AnonymousId
89-
By default we will also push the `anonymousId` and `userId`(if exists) into the `dataLayer` for each `page` or `track` call. Since the `anonymousId` is created by Segment, we will namespace that property in the `dataLayer` as `segmentAnonymousId`.
88+
By default Segment pushes the `anonymousId` and `userId`(if exists) into the `dataLayer` for each `page` or `track` call. Since the `anonymousId` is created by Segment, namespaces that property in the `dataLayer` as `segmentAnonymousId`.
9089

9190
### Environments
9291
If you're using an 'environment' variable for `gtm_preview` in your tag's query string, you can set that string in the **Environment** of your Optional Settings. IMPORTANT: Make sure the string includes the `gtm_auth` variable. For example, your string should look like: `env-xxxxx&gtm_auth=xxxxx`.

0 commit comments

Comments
 (0)