Hi Matt,
Thank you for reaching out to ShareThis support! We appreciate your focus on optimizing your website’s performance, especially regarding Google PageSpeed Insights recommendations. I’d be happy to guide you on both minifying and deferring JavaScript to achieve better results. How We Can Address Your Concern:
- JavaScript Minification:
Minifying JavaScript removes unnecessary spaces, comments, and formatting, helping reduce file size. This ensures faster code delivery and improves your website’s loading speed.
- Deferring JavaScript:
Deferring scripts allows the browser to load the main content (HTML and CSS) first, and execute JavaScript only after the page renders. This helps avoid render-blocking issues, resulting in a better user experience and improved PageSpeed scores.
Optimizing ShareThis Scripts for Your Site:
Our ShareThis tools are designed with performance in mind. However, you can take additional steps by:
- Adding the
defer
attribute to our script to ensure it loads after your page content:
<script src="https://platform-api.sharethis.com/js/sharethis.js" defer></script>
- Minifying any custom JavaScript you may have on your site. We recommend tools like Terser or UglifyJS for easy minification.
Need More Help?
If you need further assistance or encounter any issues during implementation, please don’t hesitate to let us know. We’re happy to assist you with any additional questions or adjustments.
Best regards,
ShareThis Support Team