mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
Mechanically re-derived: bin/debrand runs over a fresh import of posthog/posthog@fa1a9a60d4 (2026-08-06). The pipeline (.hanzo/workflows), the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md and the squashed initial migration are restored from the shipped tree, same as the previous import. The prune's import-closure guard kept 21 products the new core now imports; dropping them is a refactor now, recorded rather than forced.
65 lines
2.5 KiB
TypeScript
65 lines
2.5 KiB
TypeScript
import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
|
|
|
|
import { StepDefinition } from '../steps'
|
|
import { DEFAULT_SNIPPET_METHODS, snippetFunctions } from './_snippets/js-snippet-builder'
|
|
import { SDK_DEFAULTS_DATE } from './_snippets/sdkDefaults'
|
|
|
|
export const getShopifySteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
|
|
const { CodeBlock, Markdown, dedent } = ctx
|
|
|
|
return [
|
|
{
|
|
title: 'Open theme editor',
|
|
badge: 'required',
|
|
content: (
|
|
<Markdown>
|
|
In your Shopify admin, go to **Online Store** > **Themes**. Click **Actions** > **Edit code**
|
|
on your current theme.
|
|
</Markdown>
|
|
),
|
|
},
|
|
{
|
|
title: 'Add the Insights snippet',
|
|
badge: 'required',
|
|
content: (
|
|
<>
|
|
<Markdown>
|
|
Open `theme.liquid` and paste the following code just before the closing `</head>` tag:
|
|
</Markdown>
|
|
<CodeBlock
|
|
blocks={[
|
|
{
|
|
language: 'html',
|
|
file: 'theme.liquid',
|
|
code: dedent`
|
|
<script>
|
|
${snippetFunctions(DEFAULT_SNIPPET_METHODS)}
|
|
insights.init('<ph_project_token>', {
|
|
api_host: '<ph_client_api_host>',
|
|
defaults: '${SDK_DEFAULTS_DATE}'
|
|
})
|
|
</script>
|
|
`,
|
|
},
|
|
]}
|
|
/>
|
|
<Markdown>Click **Save**.</Markdown>
|
|
</>
|
|
),
|
|
},
|
|
{
|
|
title: 'Verify installation',
|
|
badge: 'recommended',
|
|
content: (
|
|
<Markdown>
|
|
Insights will now capture pageviews, clicks, and other events on your Shopify store. See the [Shopify
|
|
integration docs](https://hanzo.ai/docs/libraries/shopify) for tracking checkout events and
|
|
revenue.
|
|
</Markdown>
|
|
),
|
|
},
|
|
]
|
|
}
|
|
|
|
export const ShopifyInstallation = createInstallation(getShopifySteps)
|