DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Google Cloud Document AI Basics
  • Simplify Your Compliance With Google Cloud Assured Workloads
  • Controlling Access to Google BigQuery Data
  • Gemini 2.0 Flash (Experimental): A Deep Dive for Developers

Trending

  • How to Configure and Customize the Go SDK for Azure Cosmos DB
  • Recurrent Workflows With Cloud Native Dapr Jobs
  • Beyond Linguistics: Real-Time Domain Event Mapping with WebSocket and Spring Boot
  • Streamlining Event Data in Event-Driven Ansible

10 Rules To Integrate Third-Party Scripts

The increasing importance of Google's Core Web Vital score increases the impact of third-party scripts on SEO rankings. Learn the best practices to stay on top!

By 
Holly Chessman user avatar
Holly Chessman
·
Updated Jan. 15, 22 · Analysis
Likes (7)
Comment
Save
Tweet
Share
20.9K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

Third-party scripts can cause negative load-time effects. Why is this an issue? Well, in Google’s view, a poorly-optimized page should not rank highly. Instead, search results should favor pages with fundamental design strengths — including JavaScript minification, rapid execution time, and render-friendly scripting. 

In reflection of this belief, Google has planned the gradual release of a major update to its search algorithm that is scheduled for June through August of 2021. This update will increase the importance of a page’s loading speed as a contributing factor to a web page’s overall ranking on Google’s search results page. As a result, how third-party scripts impact page load times is becoming more important than ever. 

Don’t fear! There are a variety of steps you can take to improve your page load time and avoid getting marked down by Google. Below, I’ll provide 10 rules third-party script providers should follow to mitigate adverse effects caused by loading their scripts on customer web pages. But first, let’s start with a few basics you need to know in order to understand where to focus your energy.

Know Your Performance Ratings

Google has created a free tool known as PageSpeed Insights to help prepare site owners and builders for the upcoming change. To use PageSpeed Insights, simply input a URL to any given webpage. The tool will then analyze the site and calculate a page experience score, which I’ll cover in the next section. 

After using Google’s PageSpeed Insights tool on a few web pages, you’ll quickly realize that JavaScript is a common offender when it comes to slowdowns. Ad servers, trackers, and widgets all require JavaScript to display correctly on a webpage. These common plugins are sometimes full of bloat (e.g., unused dependencies), resource-heavy, and in need of optimization. 

Understand Page Experience Factors

Google’s new ranking signal is known as page experience, which indicates how “enjoyable” visiting a webpage may be for potential users. Google measures page experience using the following criteria: 

  • Mobile-friendliness: Including design, speed, navigation, and content flow.
  • Safe browsing: Telling visitors and web developers if pages might be compromised.
  • HTTPS implementation: Signaling whether or not a site makes a secure connection.
  • Interstitial ad presence: Determining if a site includes adverts that block content or force user interaction.
  • Core Web Vitals: NEW SIGNAL! Measuring both the speed and shifting of components on your website pages as they load into browsers.

Look Beyond SLAs

Setting up service level agreements (SLA) that continuously measure speed and availability is paramount to hitting healthy page speed rankings. SLAs also help hold vendors accountable for their commitments. At the same time, SLAs alone may be insufficient for mitigating all risks. 

External vendors can impact publishers in numerous ways, beyond page speed rankings. For example, vendor code execution can conflict with developer code, degrading the user experience for users of specific browsers or browser versions. Third-party resources can also deliver inappropriate content or harmful malware. 

To help prevent such adverse impacts, we’ve put together our top 10 rules for creating and managing third-party scripts. 

10 Rules For Creating Third-Party Scripts

1. Define and Enforce Meaningful SLAs

As a B2B service provider, you must establish clear SLAs. Ensure the SLAs are monitored and enforced so everyone across your organization understands the consequences of failure.

2. Use “ASYNC tags” to Avoid Blocking Content

The simple JavaScript code you’re using might be friendly to implement, yet it’s likely blocking page rendering during a system outage. Load your scripts asynchronously to minimize interference with other requests — including key events like DomContentLoaded and onload. Script placement before the closing body tag remains insufficient without ASYNC. Otherwise, load times will climb, pages won’t render, and bounce rates may increase significantly. 

3. Leverage Global Infrastructure for Content Delivery

Your clients place your tags on their pages and host visitors from various geographical regions. Accordingly, make your services reachable by catering to these locations. For example, U.S. West Coast servers aren’t ideal when your user base is primarily European. Strategically build your infrastructure by leaning on CDNs for static libraries and distributed DNS systems.

4. Write Safe Client-Side Code

If your JavaScript is executed on the window document (instead of your dedicated iframe), ensure that your variables, methods, objects, and events don’t conflict with existing elements. You shouldn’t be overriding, hiding, or blocking any content or pre-existing behavior. This could hurt the user experience unless it’s integral to the service (such as overlaying ads).

5. Upload Content Security 

Ensure that your system or service doesn't deliver malware, phishing, or viruses. You should also confirm that the content is website-appropriate. For example, you wouldn’t serve alcohol-related ads on kids’ websites.

6. Don’t Hide in the Shadows

Link your tag domain to an index page with your company’s information, contact details, and privacy policy. Don’t anonymize domain Whois information. There’s nothing worse than a savvy end-user noticing a domain-holding page load, without knowing who owns said domain.

7. Respect Both Client and End-User Privacy 

Craft a clear, agreeable privacy policy that remains available to end-users. Don’t log any information that contradicts those binding policies. 

8. Support all Modern Browsers and Devices 

Treat all browsers and versions with respect, being careful not to make breaking, error-inducing changes (although some JavaScript-based functionality may be lost). Keep abreast of new technology and push updates as needed. 

9. Don’t Hog Resources 

Ensure your content doesn’t greedily consume bandwidth, CPU power, memory, or other resources. Remember that you’re not the sole page tag being used. Slowness does not serve the user and can be distracting from their primary content of interest. Minimalism and smart frugal resource utilization are crucial.

10. Create a Test Plan for New Releases

Test fresh tags and code on actual client web pages to ensure they’re not problematic. Experiment with different browsers and devices to confirm functionality. Notify clients of major changes, and remember to involve them in the testing process. Transparency is important. You might otherwise break something for your clients’ end users without them knowing.

Conclusion

Whether you’re a vendor or a website owner, I hope you’ve found these guidelines helpful for creating great user experiences. You can learn more by visiting Google’s portal hosting educational content on this topic or reading this free guide containing free educational content related to this topic. 

Google (verb) Web Service

Opinions expressed by DZone contributors are their own.

Related

  • Google Cloud Document AI Basics
  • Simplify Your Compliance With Google Cloud Assured Workloads
  • Controlling Access to Google BigQuery Data
  • Gemini 2.0 Flash (Experimental): A Deep Dive for Developers

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!