Developers

New JavaScript Element in Layout & Design Tool

New JavaScript Element in Layout & Design Tool

At RebelMouse, we're constantly iterating on our platform to maximize the performance of our websites in order to keep up with the latest standards from Google's PageSpeed Insights tool.

One of the biggest problems with web performance is how the lazy loading of elements is implemented. On RebelMouse, we already have out-of-the-box capabilities that allow you to lazy-load assets, but if you have JavaScript from ads running on your site, Google's PageSpeed Insights tool will still penalize you for them if they're not being deferred off-screen properly.


We now have an elegant solution to this problem in the form of a new JavaScript element in our Layout & Design tool. Here's how it works:

With this element, you can add:

  1. A friendly name
  2. A URL source for a JavaScript library
  3. Priority for loading (standard or non-standard)
  4. The JavaScript code itself

Here's what the JavaScript element looks like:

Priority Levels

So, what priority level should you select?

  • Optimized (Beta) is best for users who want the latest cutting-edge approaches. We use it in our own development work. This priority level will pause JavaScript from firing until well after the page has fully loaded, which gives you the highest PageSpeed Insights and Core Web Vitals scores.
  • Load Blocking is used for executing JavaScript right away, and will generally have a negative impact on your PageSpeed Insights score. This priority level will fire the JavaScript immediately after the page has completed loading. This has the potential to drop your performance scores by 10–40 points depending on the extra call. We do recommend testing your page with PageSpeed Insights after switching to this choice to understand the actual impact.
  • Post LCP is the best option to blend green Core Web Vitals scores with a very fast load. This priority level will cause JavaScript to load immediately after the Largest Contentful Paint event has completed.
    • This is recommended for ads only, where you have increased revenue in delivering ads to users who are only on the page for five seconds or so.

Case Study

For one of our clients, they had an article with a mobile PageSpeed score of only 18 before any optimization:

After applying our JavaScript optimization using our new JavaScript element, they improved their mobile PageSpeed score to 75 for the same article!

If you have any questions about how to implement the new JavaScript element, feel free to reach out to support@rebelmouse.com or contact your account manager today.

What Is RebelMouse?
Request a Proposal

Where 
Websites Are Built

The Fastest Sites in the World Run on RebelMouse

Let’s Chat

new!

RebelMouse Performance Monitoring

Real-Time Core Web Vitals

Get Started
DISCOVER MORE

Our Core Features

Our platform is a complete digital publishing toolbox that's built for modern-day content creators, and includes game-changing features such as our:

animate
Layout and Design toolLayout and Design tool on mobile
animate

Why RebelMouse?

Unprecedented Scale

RebelMouse sites reach more than 120M people a month, with an always-modern solution that combines cutting-edge technology with decades of media savvy. And due to our massive scale, 1 in 3 Americans have visited a website powered by RebelMouse.

120M+ Users
550M+ Pageviews
17+ Avg. Minutes per User
6+ Avg. Pages per User

Today's Top Websites Use RebelMouse

Thanks to the tremendous scale of our network, we are able to analyze a wealth of traffic data that informs our strategies and allows us to be a true strategic partner instead of just a vendor.

upworthyindy100Vault12No Film SchoolRawStoryResponsible StatecraftPrideRolling Stone QuebecPremierGuitarPenskeINN Educate Brand ConnectThe FulcrumGZEROOkayafricaBrit+CoPaper MagazinePowerToFlyNarcityCommonDreamsAllBusiness

What Clients Say

We’re here to help you weigh and understand every tech and strategic decision that affects your digital presence. Spend less time managing everything yourself, and more time focused on creating the quality content your users deserve.

Case Studies

A Team Built Like No Other

RebelMouse employs a unique, diverse, and decentralized team that consists of 70+ digital traffic experts across more than 25 different countries. We have no central office, and we cover every time zone to ensure that we’re able to deliver amazing results and enterprise-grade support around the clock.

Our team is well-versed in all things product, content, traffic, and revenue, and we strategically deploy ourselves to help with each element across all of our clients. We thrive on solving the complex.

Let's Chat