Skip to content

Commit 52d4b79

Browse files
devin-ai-integration[bot]fern-api[bot]devalog
authored
Update integration pages to use Steps component (#2934)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <[email protected]>
1 parent b549597 commit 52d4b79

File tree

6 files changed

+255
-227
lines changed

6 files changed

+255
-227
lines changed

fern/products/docs/pages/integrations/analytics/fullstory.mdx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,34 @@ title: Fullstory
33
description: Learn how to integrate Fern Docs with Fullstory to track user behavior and analytics.
44
---
55

6-
## Add Fullstory to your Docs
6+
Integrate Fullstory to capture session replays and user interactions in your documentation.
77

8-
To add Fullstory to your Docs, you need to add your Fullstory `orgId` to your `docs.yml` file.
8+
<Steps>
9+
<Step title="Get your Fullstory Org ID">
910

10-
### Get your Fullstory Org ID
11+
Your Org ID appears in the URL when you log in to Fullstory:
1112

12-
When you login to your Fullstory account, your Org ID can be found in the URL of your browser.
13+
```
14+
https://app.fullstory.com/ui/<ORG_ID>/home
15+
```
1316

14-
```
15-
https://app.fullstory.com/ui/<ORG_ID>/home
16-
```
17+
Alternatively, find it in **Settings > Data Capture and Privacy > Fullstory Setup** in the snippet code as `window['_fs_org']`.
1718

18-
Additionally, you can find your Org ID in [Settings > Data Capture and Privacy > Fullstory Setup](https://help.fullstory.com/hc/en-us/articles/360047075853-How-do-I-find-my-Fullstory-Org-Id#:~:text=You%20can%20find%20your%20Org,embedded%20in%20the%20Fullstory%20snippet.&text=More%20information%20about%20installation%20and,the%20URL%20of%20your%20browser.)
19-
inside the Fullstory snippet:
19+
See [Fullstory's guide](https://help.fullstory.com/hc/en-us/articles/360047075853-How-do-I-find-my-Fullstory-Org-Id) for more details.
2020

21-
1. Log in to your Fullstory account.
22-
2. Find **Settings** in a dropdown by clicking your organization's name or logo in the top left.
23-
3. Navigate the sidebar to the Data Capture and Privacy section. Click on "Fullstory Setup", located under the heading.
24-
4. Retrieve the Org Id from the snippet, where it is assigned to `window['_fs_org']`. It will appear as `window['_fs_org'] = '<ORG_ID>'`.
21+
</Step>
2522

26-
You can find visual instructions in [Fullstory's guide](https://help.fullstory.com/hc/en-us/articles/360047075853-How-do-I-find-my-Fullstory-Org-Id#:~:text=You%20can%20find%20your%20Org,embedded%20in%20the%20Fullstory%20snippet.&text=More%20information%20about%20installation%20and,the%20URL%20of%20your%20browser.)
27-
about this topic.
23+
<Step title="Add Fullstory to `docs.yml`">
2824

29-
### Integrate Fullstory with your Docs
25+
In your `docs.yml` file, add your Fullstory Org ID:
3026

31-
In your `docs.yml` file, add your Fullstory Org ID:
27+
<CodeBlock title="docs.yml">
28+
```yaml
29+
analytics:
30+
fullstory:
31+
org-id: ${FULLSTORY_ORG_ID} # reads your org id from environment variables
32+
```
33+
</CodeBlock>
3234

33-
<CodeBlock title="docs.yml">
34-
```yaml
35-
analytics:
36-
fullstory:
37-
org-id: ${FULLSTORY_ORG_ID} # reads your org id from environment variables
38-
```
39-
</CodeBlock>
35+
</Step>
36+
</Steps>

fern/products/docs/pages/integrations/analytics/google.mdx

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,76 @@ title: Google Analytics
33
subtitle: Learn how to add Google Analytics to your Fern Docs for tracking and insights.
44
---
55

6-
Fern supports integrating with both [Google Analytics 4](https://developers.google.com/analytics) and [Google Tag Manager](https://tagmanager.google.com/). Follow the steps below to configure these services.
6+
Fern supports integrating with both [Google Analytics 4](https://developers.google.com/analytics) and [Google Tag Manager](https://tagmanager.google.com/).
77

88
## Google Analytics 4
99

10-
### Prerequisites
11-
1210
Before you begin, ensure you have a Google Analytics 4 property ID. This ID is typically in the format `G-XXXXXXXXXX`.
1311

14-
### Integration steps
12+
<Steps>
13+
<Step title="Add GA4 to `docs.yml`">
14+
15+
Open your `docs.yml` file and add your Google Analytics 4 property ID under the `measurement-id` key:
16+
17+
<CodeBlock title="docs.yml">
18+
```yaml
19+
analytics:
20+
ga4:
21+
measurement-id: G-12345678
22+
```
23+
</CodeBlock>
1524

16-
1. Open your `docs.yml` file.
17-
2. Add your Google Analytics 4 property ID under the `measurement-id` key.
18-
3. Verify data in Google Analytics. Note that it may take 24–48 hours for website traffic data to start appearing. You can check your browser's developer tools or the network tab to confirm that the analytics script is loading correctly.
25+
You can optionally add the ID as an environment variable:
1926

20-
Example configuration:
27+
<CodeBlock title="docs.yml">
28+
```yaml
29+
analytics:
30+
ga4:
31+
measurement-id: ${GA4_MEASUREMENT_ID} # scans for GA4_MEASUREMENT_ID environment variable
32+
```
33+
</CodeBlock>
2134

22-
<CodeBlock title="docs.yml">
23-
```yaml
24-
analytics:
25-
ga4:
26-
measurement-id: G-12345678
27-
```
28-
</CodeBlock>
35+
</Step>
2936

30-
You can optionally add the ID as an environment variable:
37+
<Step title="Verify your integration">
3138

32-
<CodeBlock title="docs.yml">
33-
```yaml
34-
analytics:
35-
ga4:
36-
measurement-id: ${GA4_MEASUREMENT_ID} # scans for GA4_MEASUREMENT_ID environment variable
37-
```
38-
</CodeBlock>
39+
Check your browser's developer tools or the network tab to confirm that the analytics script is loading correctly. Note that it may take 24–48 hours for website traffic data to start appearing in Google Analytics.
3940

41+
</Step>
42+
</Steps>
4043

4144
## Google Tag Manager
4245

43-
### Prerequisites
46+
Before you begin, obtain a container ID from your Google Tag Manager account. This ID follows the format `GTM-XXXXXX`.
47+
48+
<Steps>
49+
<Step title="Add GTM to `docs.yml`">
50+
51+
Open your `docs.yml` file and add your Google Tag Manager container ID under the `container-id` key:
4452

45-
To use Google Tag Manager, obtain a container ID from your Google Tag Manager account. This ID follows the format `GTM-XXXXXX`.
53+
<CodeBlock title="docs.yml">
54+
```yaml
55+
analytics:
56+
gtm:
57+
container-id: GTM-NS32L7KR
58+
```
59+
</CodeBlock>
4660

47-
### Integration steps
61+
You can optionally add the ID as an environment variable:
4862

49-
1. Open your `docs.yml` file.
50-
2. Add your Google Tag Manager container ID under the container-id key.
51-
3. Verify data in Google Analytics. Note that it may take 24–48 hours for website traffic data to start appearing. You can check your browser's developer tools or the network tab to confirm that the analytics script is loading correctly.
63+
<CodeBlock title="docs.yml">
64+
```yaml
65+
analytics:
66+
gtm:
67+
container-id: ${GTM_CONTAINER_ID} # scans for GTM_CONTAINER_ID environment variable
68+
```
69+
</CodeBlock>
5270

53-
Example configuration:
71+
</Step>
5472

55-
<CodeBlock title="docs.yml">
56-
```yaml
57-
analytics:
58-
gtm:
59-
container-id: GTM-NS32L7KR
60-
```
61-
</CodeBlock>
73+
<Step title="Verify your integration">
6274

63-
You can optionally add the ID as an environment variable:
75+
Check your browser's developer tools or the network tab to confirm that the analytics script is loading correctly. Note that it may take 24–48 hours for website traffic data to start appearing in Google Analytics.
6476

65-
<CodeBlock title="docs.yml">
66-
```yaml
67-
analytics:
68-
gtm:
69-
container-id: ${GTM_CONTAINER_ID} # scans for GTM_CONTAINER_ID environment variable
70-
```
71-
</CodeBlock>
77+
</Step>
78+
</Steps>

fern/products/docs/pages/integrations/analytics/mixpanel.mdx

Lines changed: 101 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -3,107 +3,104 @@ title: Mixpanel
33
description: Learn how to integrate Fern Docs with Mixpanel to track user behavior and analytics.
44
---
55

6-
## Add Mixpanel to your Docs
7-
8-
To add Mixpanel to your Docs, you need to create a custom JavaScript file and configure it in your `docs.yml` file using your Mixpanel project token.
9-
10-
### Get your Mixpanel Project Token
11-
12-
1. Log in to your Mixpanel account.
13-
2. Navigate to the project you want to track.
14-
3. Go to **Settings** > **Project Settings**.
15-
4. Copy your **Project Token** from the project details.
16-
17-
### Integration Steps
18-
19-
1. **Create a scripts folder**: Under your `fern` directory, create a `scripts` folder if it doesn't already exist.
20-
21-
2. **Create the Mixpanel script**: In the `scripts` folder, create a file named `mixpanel.js`.
22-
23-
3. **Add the Mixpanel tracking code**: In your `mixpanel.js` file, add the following script (replace `YOUR_PROJECT_TOKEN` with your actual project token):
24-
25-
<CodeBlock title="fern/scripts/mixpanel.js">
26-
```js
27-
// Add the JS snippet to load the script
28-
(function (f, b) {
29-
if (!b.__SV) {
30-
var e, g, i, h;
31-
window.mixpanel = b;
32-
b._i = [];
33-
b.init = function (e, f, c) {
34-
function g(a, d) {
35-
var b = d.split(".");
36-
if (b.length === 2) {
37-
a = a[b[0]];
38-
d = b[1];
39-
}
40-
a[d] = function () {
41-
a.push([d].concat(Array.prototype.slice.call(arguments, 0)));
42-
};
43-
}
44-
45-
var a = b;
46-
if (typeof c !== "undefined") {
47-
a = b[c] = [];
48-
} else {
49-
c = "mixpanel";
50-
}
51-
52-
a.people = a.people || [];
53-
a.toString = function (a) {
54-
var d = "mixpanel";
55-
if (c !== "mixpanel") d += "." + c;
56-
if (!a) d += " (stub)";
57-
return d;
58-
};
59-
a.people.toString = function () {
60-
return a.toString(1) + ".people (stub)";
61-
};
62-
63-
i = "disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
64-
for (h = 0; h < i.length; h++) g(a, i[h]);
65-
66-
b._i.push([e, f, c]);
67-
};
68-
b.__SV = 1.2;
69-
e = f.createElement("script");
70-
e.type = "text/javascript";
71-
e.async = true;
72-
e.src = "https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";
73-
g = f.getElementsByTagName("script")[0];
74-
g.parentNode.insertBefore(e, g);
75-
}
76-
})(document, window.mixpanel || []);
77-
78-
// Create an instance of the Mixpanel object
79-
mixpanel.init('YOUR_PROJECT_TOKEN', { autocapture: true });
80-
```
81-
</CodeBlock>
82-
83-
4. **Configure your docs.yml**: In your `docs.yml` file, add the JavaScript file configuration:
84-
85-
<CodeBlock title="docs.yml">
86-
```yaml
87-
js:
88-
- path: ./scripts/mixpanel.js
89-
strategy: beforeInteractive
90-
```
91-
</CodeBlock>
92-
93-
### Security Considerations
94-
95-
Since Mixpanel tracking is implemented using client-side JavaScript, your project token will be visible in the browser's source code. This is normal and expected behavior for client-side analytics implementations. Mixpanel project tokens are designed to be publicly visible and are safe to expose on the client side.
96-
97-
### Testing Your Integration
98-
99-
1. **Start your development server**: Run `fern docs dev` to build and start your Fern docs locally (typically on `http://localhost:3000`).
100-
101-
2. **Verify script loading**: Open your browser's developer tools and check the Console and Network tabs to confirm the Mixpanel script is loading correctly.
102-
103-
3. **Test event tracking**: Navigate through your docs site and verify that events are being tracked.
104-
105-
4. **Check Mixpanel dashboard**: Go to your Mixpanel project dashboard to verify that events are being received correctly.
106-
107-
### Additional Resources
108-
109-
For more information on Mixpanel's JavaScript SDK and advanced configuration options, visit the [Mixpanel JavaScript SDK documentation](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript).
6+
Integrate Mixpanel to track product analytics and user behavior in your documentation, including event tracking, funnel analysis, and user cohorts.
7+
8+
<Steps>
9+
<Step title="Get your Mixpanel project token">
10+
11+
In your Mixpanel project, go to **Settings > Project Settings** and copy your **Project Token**.
12+
13+
<Note>
14+
Your project token will be visible in the browser's source code. This is normal for client-side analytics and Mixpanel tokens are designed to be safely exposed on the client side.
15+
</Note>
16+
17+
</Step>
18+
19+
<Step title="Create the Mixpanel script">
20+
21+
Under your `fern` directory, create a `scripts` folder if it doesn't already exist.
22+
23+
In the `scripts` folder, create a file named `mixpanel.js` and add the following script (replace `YOUR_PROJECT_TOKEN` with your actual project token):
24+
25+
<CodeBlock title="fern/scripts/mixpanel.js">
26+
```js maxLines=10
27+
// Add the JS snippet to load the script
28+
(function (f, b) {
29+
if (!b.__SV) {
30+
var e, g, i, h;
31+
window.mixpanel = b;
32+
b._i = [];
33+
b.init = function (e, f, c) {
34+
function g(a, d) {
35+
var b = d.split(".");
36+
if (b.length === 2) {
37+
a = a[b[0]];
38+
d = b[1];
39+
}
40+
a[d] = function () {
41+
a.push([d].concat(Array.prototype.slice.call(arguments, 0)));
42+
};
43+
}
44+
45+
var a = b;
46+
if (typeof c !== "undefined") {
47+
a = b[c] = [];
48+
} else {
49+
c = "mixpanel";
50+
}
51+
52+
a.people = a.people || [];
53+
a.toString = function (a) {
54+
var d = "mixpanel";
55+
if (c !== "mixpanel") d += "." + c;
56+
if (!a) d += " (stub)";
57+
return d;
58+
};
59+
a.people.toString = function () {
60+
return a.toString(1) + ".people (stub)";
61+
};
62+
63+
i = "disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
64+
for (h = 0; h < i.length; h++) g(a, i[h]);
65+
66+
b._i.push([e, f, c]);
67+
};
68+
b.__SV = 1.2;
69+
e = f.createElement("script");
70+
e.type = "text/javascript";
71+
e.async = true;
72+
e.src = "https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";
73+
g = f.getElementsByTagName("script")[0];
74+
g.parentNode.insertBefore(e, g);
75+
}
76+
})(document, window.mixpanel || []);
77+
78+
// Create an instance of the Mixpanel object
79+
mixpanel.init('YOUR_PROJECT_TOKEN', { autocapture: true });
80+
```
81+
</CodeBlock>
82+
83+
</Step>
84+
85+
<Step title="Add Mixpanel to `docs.yml`">
86+
87+
In your `docs.yml` file, add the JavaScript file configuration:
88+
89+
<CodeBlock title="docs.yml">
90+
```yaml
91+
js:
92+
- path: ./scripts/mixpanel.js
93+
strategy: beforeInteractive
94+
```
95+
</CodeBlock>
96+
97+
</Step>
98+
99+
<Step title="Test your integration">
100+
101+
Run `fern docs dev` and check your browser's developer tools to confirm the Mixpanel script loads correctly. Navigate through your docs and verify events appear in your Mixpanel dashboard.
102+
103+
For advanced configuration options, see the [Mixpanel JavaScript SDK documentation](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript).
104+
105+
</Step>
106+
</Steps>

0 commit comments

Comments
 (0)