Instrument on third-party site builders

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 provides support for the instructions and processes contained 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?

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. 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 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 JavaScript SDK snippet and code to your site.

To do so, follow these steps:

  1. Go to Settings 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 appears 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 have said 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 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 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 JavaScript 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 JavaScript 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 tag on every page in your site. This is where the Amplitude JavaScript SDK install snippet is.**
    • 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 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.
Was this page helpful?

Thanks for your feedback!

July 4th, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.