UXWizz 10.0 is here — Build branded dashboards for every client → View changelog

Self-hosted alternatives to third-party scripts

Third-party scripts can affect visitor privacy, page speed, and your exposure to supply-chain attacks.

I removed every third-party JavaScript include from my landing page without losing the features I needed.

These are the external services I replaced:

  1. Analytics (Google Analytics)
  2. Live chat widget (Tawk.to)
  3. Newsletter sign-up form (Mailchimp)
  4. Web Fonts (Google Fonts)

Analytics


Problem: Measuring visits and conversions

Google Analytics is one of the most common third-party scripts on the web. It sends visitor data to an external analytics provider, which may not fit every site's privacy or data-control requirements.

Solution: Self-hosted analytics

A privacy-focused analytics platform can reduce the data you share with third parties. Self-hosting also gives you direct control over storage, access, and retention.

See this directory of privacy-friendly analytics platforms for more options.

I use UXWizz because I built it for this job: self-hosted website stats, heatmaps, recordings, goals, and error tracking on a PHP and MySQL server.

Watch the UXWizz segmentation demo (MP4)

Live chat widget


Problem: Letting visitors contact you from the website

I used the chat widget from tawk.to. It worked well, but I had two issues:

  1. They were using Google Fonts and some other 3rd party resources
  2. Loading their widget slowed down the site and sometimes resulted in a white content flash

Solution: Email contact form

Before looking for a replacement I realized that I never used the live chat functionality but only used it as a way for users to send me an email from the landing page. It was just a contact form.

I implemented a simple HTML form and use Web3Forms to handle submissions. It provides the few features I need and is made by an independent developer.

You can check out the form in the bottom right corner of this site.

Self hosted contact form Basic HTML/CSS/JS contact form

Running my own SMTP server would remove that dependency, but it takes more time to configure and maintain correctly, so I postponed it.


Newsletter sign-up form


Problem: Letting visitors subscribe to a newsletter

Promotional popups can increase sign-ups, but they also interrupt the visitor. Embedded forms from an email service may add more third-party scripts and requests to the page.

Solution: Link to external sign-up form

One option is to host the required form code yourself. Another is to build a small form that forwards the request to your email service.

I chose a simpler approach: a button that opens the email provider's sign-up form on its own website.

Newsletter sign-up button The newsletter sign-up button opens the sign-up form in a new tab

As the newsletter is not a core part of my business (I only send one or two newsletters per year) I have moved the button in the footer of the website.


Web Fonts


Problem: I want nice typography on my website

Google Fonts is a large typography collection. Many sites load fonts such as Roboto, Open Sans, or Inter from Google's servers. That creates an external request whenever a visitor opens the page.

Solution: Download and serve fonts locally

You can download the font files and serve them from your own server.

One open-source tool for this is Google Webfonts Helper.

Once downloaded you can include them like this:

<link rel="preload" href="/css/roboto-v20-latin-regular.woff2" as="font">
<link rel="preload" href="/css/roboto-v20-latin-700.woff2" as="font">


See what visitors do on your website

UXWizz combines stats, heatmaps, session recordings, goals, events, and error tracking on your own server.
Try UXWizz free

You can also email us at support@uxwizz.com
Your email address will only be used for this inquiry and will not be saved or used for marketing.