FAQ: Instrument Amplitude on third-party website builders

  • Updated

This article covers some frequently asked questions about using Amplitude with third-party website builders.  

NOTE: These instructions may become outdated as the third-party platforms under discussion here make changes and upgrades. Amplitude's Support team will provide support for the instructions and processes contained in this article only; they cannot provide recommendations for anything not included here.

How do I instrument Amplitude on a third-party website builder?

Your website may not be natively built, but is instead built on a third-party website builder like Wix or Squarespace. Like a website built natively, most third-party website 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 your natively-built website. Generally, you will need to add the JS SDK snippet to the header and the rest of the JS SDK code in the body. 

If you don't have access to the header or underlying source code for the third-party's website, you should still be able to 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 JS SDK snippet and code to your site.

To do so, follow these steps:

  1. Go toSettings in your site's dashboard.
  2. Click the Tracking & Analytics tab, under Advanced Settings.
  3. Click + New Tool and select Custom.
  4. Set up your custom code:
    1. Enter your custom code.
    2. Select the relevant domain. This option will appear only if you have multiple domains.
    3. Enter a name for your custom code.
    4. 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.
    5. Place Code in: Select where the code snippet in placed in your site's code.
  5. Click Apply.

Some customers have told us that Wix allows you to add header scripts, but not to call functions from them. One suggested workaround is putting 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 to your site.

NOTE: These features may be premium features, only available in Business and Commerce plans.

Code Injection

Use Code Injection to add Amplitude’s JS 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. There are site-wide code injection and per-page code injection options. See this page for a per-page code injection option. If you add code to Code Injection, Squarespace may ask you to disable it while editing your site.

Next, add the JS SDK install snippet with Code Injection by following these steps:

  1. Open Code Injection. In the Home menu, navigate to Settings > Advanced > Code Injection.
  2. Add JS SDK code into the appropriate Code Injection fields for the header, footer, lock page, or order confirmation page.
    • Header: Code added here is injected into the <head> tag on every page in your site.This is where the Amplitude JS SDK install snippet will be.
    • Learn more about your other three options here.
  3. After adding your code, click Save.

Code Block

Use Code Block to set up logEvent, user properties etc calls. To add JavaScript to a Code Block field, surround the code with <script></script> tags.

To add a Code Block, follow these steps:

  1. Edit a page or post, click an insert point, and select Code from the menu. For help, visit Adding content with blocks.
  2. Add your code in the text field: see our Using the SDKs documentation for the event and properties calls.
  3. If you're using the Code Block to display code snippets, check Display Source.
  4. Click Apply to save your changes.