We've rebranded — userTrack is now called UXWizz! Click for more info.

Self-hosted alternatives to replace 3rd party scripts

There are potential major issues with using 3rd party scripts on your site: they affect user privacy, slow down the website loading speed and can enable global scale security exploits.

I have managed to remove all 3rd party JavaScript includes from my landing page without compromising functionality.

Those were the external services that I was using or you might be using too:

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

Analytics


Problem: Gathering visitors statistics and conversions rates of your site

Google Analytics is one of the most commonly included 3rd party scripts on the web.
This is a huge privacy issue because it means that single a entity (Google) can not only track a user across the web but it can also gather data of user behavior at scale, possibly giving them an unfair advantage that can damage other businesses.

Solution: Self-hosted analytics

A good solution would be to use a privacy-friendly analytics platform. An even better solution is to self-host your analytics platform so that no data is shared in any way with 3rd parties.
You can find here a list of good privacy-friendly analytics platforms.

I have decided to go with UXWizz, not only because I made it but also because it's the most performant self-hosted solution for small websites, which means that you can easily run it on a low-power server.


Live chat widget


Problem: Allow customers to get in touch directly from your website

I have been using the chat widget from tawk.to. I had a really good experience with them, my only issues were:

  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 ended up implementing a simple HTML form. To handle the form submissions I decided to go the easy path and use a 3rd party API, in this case I chose Web3Forms as it has all the basic features I need and it's also 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

The more private solution would have been to setup and use my own SMTP server to deliver the emails, but this step takes a bit more time to do correctly so I post-poned it.


Newsletter sign-up form


Problem: Allow users to sign-up to your newsletter

I would strongly advise anyone against using any sort of promotional popups, especially newsletter popups.
Yes, popups do work and can increase conversion rates but at the cost of drastically damaging the user experience.
If you do care more about profits than the users, then there is still the potential privacy issue that comes with including newsletter pop-ups directly from the email servies (eg. Mailchimp) as you must include scripts and resources served from their servers.

Solution: Link to external sign-up form

A good solution for this is to either download include locally the required HTML and scripts for the pop-up or to create your own basic form that forwards the request to the email service.

I decided to go with an even simpler solution, instead of having the form directly on my site I just added a button that links to the email service provider form on their 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 really awesome typography collection. There are A LOT of websites that use fonts hosted by them, usually Roboto, Open Sans or Inter. The obvious problem that arises is that requests to the Google servers are made from your computer whenever you access any website that includes those fonts.

Solution: Download and serve fonts locally

The good news is that it's really easy to download the fonts and serve them from your own server.
You can download Google fonts using an awesome open-source tool called 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">


Do you want to improve your website?

I am building UXWizz, a self-hosted analytics platform that enables business owners to understand their visitors and improve their websites in a private and affordable way.
Improve your website

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