N
N
Nazar2020-10-01 12:33:17
Google Analytics
Nazar, 2020-10-01 12:33:17

Why doesn't PageSpeed ​​INSIGHTS accept recaptcha and its analytics code?

Hello!
Checking the resource for download speed, I saw bad indicators that change after I delete the captcha (especially 3 versions) and the metric (+25-30 hp). Connection example:

<script src="https://www.google.com/recaptcha/api.js?onload=ReCaptchaCallbackV3&render={{ config('captcha_v3.recaptcha_site_key') }}"
            async defer>
</script>

<script>
    ReCaptchaCallbackV3 = function () {
        grecaptcha.ready(function () {
            grecaptcha.execute("{{ config('captcha_v3.recaptcha_site_key') }}")
                .then(function (token) {
                    if (document.getElementById('g-recaptcha-response'))
                        document.getElementById('g-recaptcha-response').value = token;
                });
        });
    };
</script>


Maybe the problem is in the connection method? But, as far as I can see, Google's CDN draws a lot of resources when loading a page, which affects PageSpeed ​​INSIGHTS so much. But there is no way to do without it.
I will be grateful for any answer.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question