Impact on performance
What is the file size of the tag?
Section titled What is the file size of the tag?The standard version of the Contentsquare tag is compressed to 110.4 KB, and transferred from the Contentsquare CDN to the browser, compressed by gzip.
The size of the tag increases with the number of options that you enable, yet Contentsquare always optimizes the bundle size of your tag.
Additional, custom integrations with other third-party services can also increase the file size.
How long is the tag cached for?
Section titled How long is the tag cached for?The Contentsquare tag is cached locally on a customers browser for 15 minutes, meaning that it should only be loaded once during the life of a typical browsing session. However, if it passes the 15 minute mark in a session, the only time the tag will be downloaded again is if a new version of the tag is deployed to the CDN.
How will it impact page performance?
Section titled How will it impact page performance?The Contentsquare tag should be executed just after the Document Object Model (DOM) has finished its “load” event. Our recommended approach is to put the tag in the <head>
element of your HTML page, with a defer
attribute; this will make the browser download the tag asynchronously while it continues to parse the HTML, and once the DOM is ready, it will execute the tag.
This also means the Contentsquare tag should never impact any “paint” metrics, such as Time to First Byte (TTFB), First Contentful Paint (FCP) or Largest Contentful Paint (LCP).
The only metrics that the Contentsquare tag should have any impact on would be Total Blocking Time (TBT), Time to Interactive (TTI) and Interaction to Next Paint (INP). How much impact the tag has, depends entirely on how large the DOM is, and how often the DOM is “mutated” when the page is interacted with.
A page with a moderately sized DOM, where moving around the page doesn’t change the HTML (aka “mutate”) too much, will mean the impact on Total Blocking Time should be very minimal.
Examples would be:
- Desktop device with good processing power, good broadband connection, modern browser - the tag would have an impact of between 0ms and 50ms.
- Mobile device with average processing power, 4G connection, modern browser - the tag would have an impact of between 25ms and 100ms.
If the Total Blocking Time impact from synthetic testing is showing higher than these examples, then it may be due to:
- The Document Object Model (DOM) being large, over 2000 nodes
- Mutation of the DOM being excessive, creating lots of network requests and thereby increasing load on the CPU
- Device being tested on is very old and has minimal processing power
- The synthetic test is on an old simulated mobile device (such as
Moto G4
), and is exaggerating the impact of JavaScript converting “short tasks” into “long tasks” that wouldn’t correlate to a real-world scenario.
What does this mean for Core Web Vitals?
Section titled What does this mean for Core Web Vitals?The only Core Web Vital that would be affected by the Contentsquare tag is First Input Delay. This is a real user metric that relates to the synthetic metric Total Blocking Time.
You can track Core Web Vital scores via Google’s public BigQuery database, and viewed from a Google Data Studio dashboard.
Follow the instructions on this link to set it up for your website: https://g.co/chromeuxdash ↗
Which performance metrics can the tag impact?
Section titled Which performance metrics can the tag impact?The Contentsquare tag will only impact metrics after it has loaded, parsed, and executed. This means that it will not impact any paint metrics such as FCP, LCP or Speed Index. It will also not affect stability metrics such as Cumulative Layout Shift (CLS).
Here is a table that shows which metrics can be impacted by the Tag.
Metric Name | Impacted by CS Tag? |
---|---|
Time to First Byte (TTFB) | No |
First Meaningful Paint (FMP) | No |
Largest Contentful Paint (LCP) | No |
Speed Index | No |
Cumulative Layout Shift (CLS) | No |
Time to Interactive (TTI) | Yes |
Total Blocking Time (TBT) | Yes |
Interaction to Next Paint (INP) | Yes |
How many requests will the tag make?
Section titled How many requests will the tag make?The number of requests the Contentsquare tag will make depends on how many features are activated. If Session Replay is live, then there will be several requests made as the customer navigates around the website. These are batched up and sent as small HTTP POST or GET requests.
If the Document Object Model (DOM) is being changed in any way while the user browses around the page then this can trigger more requests.
Additionally, if the tag is also enabled for capturing errors, then this will trigger a new request per error occurrence on the page.
How big are the requests that are posted by Contentsquare?
Section titled How big are the requests that are posted by Contentsquare?The requests posted to Contentsquare’s API vary depending on the information sent. However, the majority are tiny, typically under 500 bytes.