I have a problem with lcp score in core web vitals (mobile). My LCP score is 3 seconds. The required lcp score is 2.5 seconds in mobile. I have tried everything. Have optimized images with a premium plugin (EWWWW Image Optimizer). Serving the files through a CDN. Reduced the network requests to a minimum and applied other things which are common. The only way I can get the lcp score down is by removing gtag.js. This reduces the lcp to 2 seconds but I really need this script for analyzing the traffic. Is there any other way I can reduce the LCP? HAve tried all the suggestions listed in Lighthouse. Removed Unused CSS,JS. Defered Loading of Images, CSS, JS.
Gtag.js increasing LCP in pagespeed insights
2.6k views Asked by samiullah ilyas At
2
There are 2 answers
0
Tony McCreath
On
On the live site, the slider image is the LCP, and this is loaded via CSS. The browser does not know to load the image until the CSS is loaded and it knows the image is needed on the page. You could speed things up with a preload on that image.
You're also using a lot of web fonts. You would free up bandwidth for the main image by reducing the number of fonts.
Related Questions in GOOGLE-ANALYTICS
- Loading Google Analytics after the user consents to cookie usage
- Google Analytics doesnt register events when redirected in a second page
- Remix App - Error: Minified React error #418 / #423 - on Google Analytics gtag script
- Google Analytics 4 does not show data (realtime/debugview)
- Google Analytics API - requesting all deviceId for particular UTM-marker
- Firebase analytics data not accurate
- GA Preview Says Tags are Working on Ngrok But Not on Production?
- link_url is truncating URL after 100 character in GA4
- more_than_30_sec event in GA4 strange behavior
- Rest arguments not working for gtag setup
- Retrieve visitor's Google query, pass it to the URL parameters and collect it for analytics purposes
- how do i do to configure user consent in ngx-google-analytics?
- How do I create a GA4 report showing event count when the events have unique/custom names?
- Google Analytics API error - User does not have sufficient permissions for this profile
- Events transmitted through the Measurement Protocol with the user_id are not received in GA4
Related Questions in GOOGLE-TAG-MANAGER
- Google Analytics doesnt register events when redirected in a second page
- Google Analytics 4 does not show data (realtime/debugview)
- Load dataLayer Variables prior to gtag configuration in GTM
- Google Task Manager with Goole Consent with custom Consent Popup
- GTM GA4 Custom HTML tag to new Google Tag - possible?
- Share link preview on whatsapp contain google tag manager code
- more_than_30_sec event in GA4 strange behavior
- How do I track use of google translate widget in GTM?
- Retrieve visitor's Google query, pass it to the URL parameters and collect it for analytics purposes
- How do I create a GA4 report showing event count when the events have unique/custom names?
- Cookiebot via GTM / no conversions in Google ADS
- Events transmitted through the Measurement Protocol with the user_id are not received in GA4
- How can I track quiz answers width GTM?
- How to setup signup tracking for Googles oauth2 signup cross-domain with google tag manager
- GA4 doesn't collect my event parameter but GTM collects
Related Questions in PAGESPEED
- how to remove unused js of a page with JQuery?
- Google Tag Manager seems to slow down website (according to PageSpeed)
- Why PageSpeed Insights is not updating/changing my webpage Discover what your real users are experiencing?
- Defer in script tag not work as script evaluates before HTML is parsed
- How to set specific width and height of a div element when media queries are present in css file?
- ReferenceError: tdbMenu is not defined at HTMLDocument.<anonymous>
- Page speed insight shows FID & INP not applicable in desktop & mobile
- How to eliminate "Avoid Large Layout Shifts" for the below code?
- Error! Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)
- Slow pagespeed render delay
- How to further mitigate bad web vitals LCP results?
- How to optimize largest contentful paint time of responsive image that fills the whole screen
- How to improve my First Contentful Paint (FCP) and Largest Contentful Paint (LCP)
- script-src missing according to Google Page Speed although it's in the .htaccess
- WordPress add_action('wp_head'... not working
Related Questions in PAGESPEED-INSIGHTS
- How to disable link rel="preload" on responsive?
- PSInsights error Lighthouse unable to reliably load page request. Make sure testing correct URL and server is responding to requests. Status code: 410
- Page speed insight shows FID & INP not applicable in desktop & mobile
- React.lazy doesn't improve lighthouse or PageSpeed Insights score. Is it a problem actually?
- PagespeedInsights shows defer offscreen images even when image is lazy loaded?
- If the Core Web Vitals assessment has passed and is all green, do I need to worry about the next section, "Diagnose Performance Issues"?
- Page Speed Insights Failure
- how can i fix Largest contentful paint (lcp) issue for mobile
- How to optimize largest contentful paint time of responsive image that fills the whole screen
- "Unattributable" in reduce javascript excution time in Page Speed Insights tool? What does it mean and how to fix?
- Why PageSpeed shows Unattributable JavaScript execution time?
- Pagespeed Insights doesn't use gzip
- Poor CLS score in page speed insight and Lighthouse
- CLS issue reported in Search console but not in Pagespeed insights
- PageSpeed Insight is showing a low performance for an Angular SPA app
Related Questions in CORE-WEB-VITALS
- Spying on useReportWebVitals from next web vitals in vitest
- How do I dig deeper in the Performance panel for a function call that consumes a long time but 90% of the time was just waiting?
- Is the web vitals js sdk/library sending reports to RUM in a delayed period?
- How do I check more details of a long task in my Web Devtools Performance panel?
- Is there any possible way to exempt a page or a group of pages to be counted under origin?
- What do the values in the attribution object mean when analyzing element-level INP scores with Google's Web Vitals library?
- First Input Delay (FID) and Interaction to Next Paint (INP) showing N/A in the google pagespeed for a Website
- How to further mitigate bad web vitals LCP results?
- How to Improve Core Web Vitals Affected by AdSense Scripts?
- Module not found: Can't resolve 'next/web-vitals'
- Poor CLS score in page speed insight and Lighthouse
- Avoid an Excessive DOM Size in case of forms where country dropdown having 220 country list
- How to measure First Screen Paint?
- Measure Interaction to Next Paint (INP) with automated clicking on all elements
- Still receiving no First Input Delay (FID) or Interaction to Next Paint (INP) across website under Pagespeed Insights
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The PageSpeed Insights results that stand out to me are:
In the mobile test, PSI reports 3.5 seconds spent on the main thread, with 1.275 s on style and layout. I think some of this can be attributed to the large DOM. So try to find ways to trim excess content or markup from the page to simplify the HTML structure.
Script evaluation also accounts for 0.987 s, suggesting that there is significant JavaScript code that runs on page load. I'm not too familiar with GTM but based on the results it does seem like it's contributing a lot to main thread consumption (2.88 s). Some things to check are disabling or removing unnecessary services in GTM, as these third parties can be adding excess JavaScript, and optimizing the services you do need so that anything not absolutely necessary for the initial page load is deferred until later. See the Loading Third-Party JavaScript guide for some additional advice related to GTM.