Instrument Amplitude on third-party site builders
このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。
Website builders such as Wix and Squarespace don't give you direct access to the page template, so you add the Amplitude Browser SDK through the builder's own code injection feature. The approach differs by platform and by plan tier.
These instructions may become outdated as the third-party platforms covered here make changes and upgrades. Amplitude's Support team provides support for the instructions and processes in this article only; they can't provide recommendations for anything not included here.
How do I instrument Amplitude on a third-party website builder?
If your site runs on a third-party website builder like Wix or Squarespace, most builders have an underlying code base you can use. Add Amplitude's JavaScript SDK to that space, as if you were adding the SDK to a natively-built website. Add the JavaScript SDK snippet to the header, and the rest of the JavaScript SDK code in the body.
If you don't have access to the header or underlying source code, you can use webhooks to combine a trigger or automation with an HTTP target to Amplitude's server-side endpoint, HTTP v2.
How do I instrument Amplitude on Wix?
Wix has a Tracking Tools & Analytics feature, which you can use to embed Amplitude's JavaScript SDK snippet and code in your site.
To do so, follow these steps:
- Go to Settings in your site's dashboard.
- Click the Tracking & Analytics tab, under Advanced Settings.
- Click + New Tool and select Custom.
- Set up your custom code:
- Enter your custom code.
- Select the relevant domain. This option appears only if you have multiple domains.
- Enter a name for your custom code.
- Add Code to Pages: Select which pages to add your code to:
- All Pages: Click the dropdown and select either Load code once, or Load code on each new page.
- Choose specific pages: Begin typing the name of the relevant pages. Then click the checkbox next to the relevant page.
- Place Code in: Select where to place the code snippet in your site's code.
- Head: This is where to place the JS SDK install snippet on every page to track analytics.
- Body: This is where all other calls like logEvent and user properties should go.
- Click Apply.
Some customers have reported that Wix lets you add header scripts but not call functions from them. One workaround is to put the necessary script in the Public folder.
Further reading on Wix
How do I instrument Amplitude on Squarespace?
Squarespace's Code Injection and Code Block features let you embed Amplitude's JS SDK snippet and code in your site.
These features may be premium features, only available in Business and Commerce plans.
Code Injection
Use Code Injection to add Amplitude's JavaScript SDK install snippet and other scripts that enhance specific parts of your site, like an order confirmation page.
To add JavaScript to a Code Injection field, surround the code with <script></script> tags. Site-wide and per-page code injection options are both available. For the per-page code injection option, refer to Squarespace's Code Injection article. If you add code to Code Injection, Squarespace may ask you to disable the code while editing your site.
To add the JavaScript SDK install snippet with Code Injection:
- Open Code Injection. In the Home menu, navigate to Settings > Advanced > Code Injection.
- Add JavaScript SDK code into the appropriate Code Injection fields for the header, footer, lock page, or order confirmation page.
- Header: Code added here goes into the
<head>tag on every page in your site. The Amplitude JavaScript SDK install snippet belongs here. - For information on the other three options, refer to Squarespace's Code Injection article.
- Header: Code added here goes into the
- After adding your code, click Save.
Code Block
Use Code Block to set up logEvent, user properties, and similar calls. To add JavaScript to a Code Block field, surround the code with <script></script> tags.
To add a Code Block, follow these steps:
- Edit a page or post, click an insert point, and select Code from the menu. For help, refer to Adding content with blocks.
- Add your code in the text field. For event and property calls, refer to the Browser SDK 2 documentation.
- If you're using the Code Block to display code snippets, check Display Source.
- Click Apply to save your changes.
これは役に立ちましたか?
For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.