-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add next-js to product analytics onboarding docs (#20239)
* add next to product analytics docs * fix spelling
- Loading branch information
1 parent
7ae44b8
commit 6c32341
Showing
6 changed files
with
44 additions
and
21 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
frontend/src/scenes/onboarding/sdks/product-analytics/AllJSFinalSteps.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CodeSnippet, Language } from 'lib/components/CodeSnippet' | ||
|
||
function JSEventSnippet(): JSX.Element { | ||
return ( | ||
<CodeSnippet language={Language.JavaScript}>{`posthog.capture('my event', { property: 'value' })`}</CodeSnippet> | ||
) | ||
} | ||
|
||
export const ProductAnalyticsAllJSFinalSteps = (): JSX.Element => { | ||
return ( | ||
<> | ||
<h4>Send events</h4> | ||
<p> | ||
Click around and view a couple pages to generate some events. Our package automatically captures them | ||
for you. | ||
</p> | ||
<h4>Optional: Send a manual event</h4> | ||
<p>If you'd like, you can manually define events, too.</p> | ||
<JSEventSnippet /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
frontend/src/scenes/onboarding/sdks/product-analytics/html-snippet.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
import { LemonDivider } from '@posthog/lemon-ui' | ||
import { CodeSnippet, Language } from 'lib/components/CodeSnippet' | ||
|
||
import { SDKHtmlSnippetInstructions } from '../sdk-install-instructions/html-snippet' | ||
|
||
function JSEventSnippet(): JSX.Element { | ||
return ( | ||
<CodeSnippet language={Language.JavaScript}>{`posthog.capture('my event', { property: 'value' })`}</CodeSnippet> | ||
) | ||
} | ||
import { ProductAnalyticsAllJSFinalSteps } from './AllJSFinalSteps' | ||
|
||
export function HTMLSnippetInstructions(): JSX.Element { | ||
return ( | ||
<> | ||
<SDKHtmlSnippetInstructions /> | ||
<LemonDivider thick dashed className="my-4" /> | ||
<h4>Optional: Send a manual event</h4> | ||
<p>Our snippet will autocapture events for you, but you can manually define events, too!</p> | ||
<JSEventSnippet /> | ||
<ProductAnalyticsAllJSFinalSteps /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
frontend/src/scenes/onboarding/sdks/product-analytics/js-web.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
import { LemonDivider } from '@posthog/lemon-ui' | ||
import { CodeSnippet, Language } from 'lib/components/CodeSnippet' | ||
|
||
import { SDKInstallJSWebInstructions } from '../sdk-install-instructions' | ||
|
||
function JSEventSnippet(): JSX.Element { | ||
return ( | ||
<CodeSnippet language={Language.JavaScript}>{`posthog.capture('my event', { property: 'value' })`}</CodeSnippet> | ||
) | ||
} | ||
import { ProductAnalyticsAllJSFinalSteps } from './AllJSFinalSteps' | ||
|
||
export function JSWebInstructions(): JSX.Element { | ||
return ( | ||
<> | ||
<SDKInstallJSWebInstructions /> | ||
<LemonDivider thick dashed className="my-4" /> | ||
<h4>Optional: Send a manual event</h4> | ||
<p>Our package will autocapture events for you, but you can manually define events, too!</p> | ||
<JSEventSnippet /> | ||
<ProductAnalyticsAllJSFinalSteps /> | ||
</> | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
frontend/src/scenes/onboarding/sdks/product-analytics/next-js.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { LemonDivider } from '@posthog/lemon-ui' | ||
|
||
import { SDKInstallNextJSInstructions } from '../sdk-install-instructions/next-js' | ||
import { ProductAnalyticsAllJSFinalSteps } from './AllJSFinalSteps' | ||
|
||
export function ProductAnalyticsNextJSInstructions(): JSX.Element { | ||
return ( | ||
<> | ||
<SDKInstallNextJSInstructions /> | ||
<LemonDivider thick dashed className="my-4" /> | ||
<ProductAnalyticsAllJSFinalSteps /> | ||
</> | ||
) | ||
} |