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/quickstart.md
+26-25Lines changed: 26 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,34 @@ When you create a source in the Segment web app, it tells the Segment servers th
25
25
26
26
You can choose to install Segment to your site in 1 of 2 ways:
27
27
28
-
[a. Install Segment as a NPM package](#step-2a-install-segment-as-a-npm-package)
28
+
[a. Add the Segment snippet to your app](#step-2a-add-the-segment-snippet)
29
29
30
-
[b. Add the Segment snippet to your app](#step-2b-add-the-segment-snippet)
31
30
32
-
### Step 2a: Install Segment as a npm package
31
+
[b. Install Segment as a NPM package](#step-2b-install-segment-as-a-npm-package)
32
+
33
+
### Step 2a: Add the Segment Snippet
34
+
35
+
To add the Segment snippet to your app:
36
+
37
+
Paste the snippet into the `<head>` tag of your site to install Segment.
38
+
39
+
{% include content/snippet-helper.md %}
40
+
41
+
Replace `YOUR_WRITE_KEY` in the snippet you pasted with your Segment project's **Write Key**. [Find the write key](/docs/connections/find-writekey/) in your project set up guide or in the source's settings.
42
+
43
+
> info ""
44
+
> When you use Analytics.js in device-mode, the source's Write Key is public, because it runs in a user's browser and can be accessed using the browser's developer tools. If this is not acceptable to your organization, you can explore [other Segment Sources](/docs/connections/sources/catalog/) which collect data from a server-based installation, and which are not accessible to the user.
45
+
46
+
That snippet loads Analytics.js onto the page _asynchronously_, so it won't affect your page load speed. Once the snippet is running on your site, you can turn on destinations from the destinations page in your workspace and they start loading on your site automatically.
47
+
48
+
Note that you should remove other native third-party destination code that you might have on your site. For example, if you're using Segment to send data to Google Analytics, make sure you remove the Google Analytics snippet from your site source code to prevent sending the data twice.
49
+
50
+
> info ""
51
+
> If you only want the most basic Google Analytics setup, there's no need to continue with the setup. Just toggle on Google Analytics in the Segment interface.
52
+
53
+
A lot of analytics and marketing tools need to record who each user is on your site. If you want to use any tool that deals with the identity of your users, read on about the Identify method.
54
+
55
+
### Step 2b: Install Segment as a npm package
33
56
34
57
To install Segment as a npm package:
35
58
@@ -61,28 +84,6 @@ To install Segment as a npm package:
61
84
62
85
For more initialization patterns and general information on `@segment/analytics-next`, see the repository's [README](https://github.com/segmentio/analytics-next/tree/master/packages/browser){:target="_blank"}.
63
86
64
-
### Step 2b: Add the Segment Snippet
65
-
66
-
To add the Segment snippet to your app:
67
-
68
-
Paste the snippet into the `<head>` tag of your site to install Segment.
69
-
70
-
{% include content/snippet-helper.md %}
71
-
72
-
Replace `YOUR_WRITE_KEY` in the snippet you pasted with your Segment project's **Write Key**. [Find the write key](/docs/connections/find-writekey/) in your project set up guide or in the source's settings.
73
-
74
-
> info ""
75
-
> When you use Analytics.js in device-mode, the source's Write Key is public, because it runs in a user's browser and can be accessed using the browser's developer tools. If this is not acceptable to your organization, you can explore [other Segment Sources](/docs/connections/sources/catalog/) which collect data from a server-based installation, and which are not accessible to the user.
76
-
77
-
That snippet loads Analytics.js onto the page _asynchronously_, so it won't affect your page load speed. Once the snippet is running on your site, you can turn on destinations from the destinations page in your workspace and they start loading on your site automatically.
78
-
79
-
Note that you should remove other native third-party destination code that you might have on your site. For example, if you're using Segment to send data to Google Analytics, make sure you remove the Google Analytics snippet from your site source code to prevent sending the data twice.
80
-
81
-
> info ""
82
-
> If you only want the most basic Google Analytics setup, there's no need to continue with the setup. Just toggle on Google Analytics in the Segment interface.
83
-
84
-
A lot of analytics and marketing tools need to record who each user is on your site. If you want to use any tool that deals with the identity of your users, read on about the Identify method.
0 commit comments