Announcement

Collapse
No announcement yet.

I can't add a banner consentiment of Quantcast (GDPR)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I can't add a banner consentiment of Quantcast (GDPR)

    Hello.
    I want install a banner of consentiment of Quantcast, I create the code in this url:
    https://www.quantcast.com/gdpr/quant...ce-self-serve/

    I insert the code in header template, and when insert the code and save, I have this error message:
    Code:
    Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /home/myuser/public_html/foro/includes/vb_template.php on line 62
    If I insert the code in block (adminpc-forums-blocks) I don't have a problem, but only appear the GPRD in the index forum, for this reasson, I try insert in header template for appear in all pages.

    Thanks and regards.

  • #2
    You should reconfigure your header. 90% of your custom CSS and Javascript should go into external files and this will reduce the amount of PHP processing needed for the template.

    Other than that, your only option is to increase the amount of memory allowed.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.

    Comment


    • #3
      Hi,
      Originally posted by Wayne Luke View Post
      You should reconfigure your header. 90% of your custom CSS and Javascript should go into external files and this will reduce the amount of PHP processing needed for the template.
      In my header, only I have two more lines (for analytics and other that now I don't remember )
      You indicate I can insert this code in my custom CSS?
      If its yes, I don't know how made this...

      Other than that, your only option is to increase the amount of memory allowed.
      I can increase the amount of memory allowed, but I preferer the first option.

      Thanks and regards.

      Comment


      • #4
        On Forocable? Looking at the source code of the page, I see at least 300 lines of custom inline Javascript and over 100 lines of custom inline CSS. This is coming from somewhere in the templates or from your Addons. It shouldn't be inline. It should be loaded from external files. Every line of code in your templates has to be parsed to PHP when the template is saved. This PHP is run on every page load. More complex templates require more memory to run them.

        You can't include Javascript in your custom CSS.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
        vBulletin 5 Documentation - Updated every Friday. Report issues here.
        vBulletin 5 API - Full / Mobile
        I am not currently available for vB Messenger Chats.

        Comment


        • #5
          It must be by Addons. Now that I remember, we had to add custom css for the theme.
          I do not remember anything else having added header template manually speaking (except for analytics and a separate line that I do not remember now).
          I do not have the necessary knowledge to move all of this to external files.
          And yes, I appreciate a load slowdown due, now because you mention it, load in templates ...

          Comment


          • #6
            Originally posted by Wayne Luke View Post
            ...It should be loaded from external files. ...
            I was think...how I can add this code in external file?
            Create the php file with the code and in the header template call to this file?

            Thanks and regards!

            Comment


            • #7
              You would put the javascript in a file with the JS extension. Then you would link it with the script tag like this tutorial - https://www.w3schools.com/tags/att_script_src.asp

              You would put your custom CSS in in a file with the CSS extension. Then you would link it with the link tag like this tutorial - https://www.w3schools.com/tags/tag_link.asp

              These are basic HTML commands you need to know if you're going to customize your site with all the different addons and external advertising that you have added. Otherwise, you'll need to pay someone by the hour to do it for you.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud customization and demonstration site.
              vBulletin 5 Documentation - Updated every Friday. Report issues here.
              vBulletin 5 API - Full / Mobile
              I am not currently available for vB Messenger Chats.

              Comment


              • #8
                Thanks Wayne.

                I read the links, at the first, appears easy...

                For start, I want add the code of quantcast (if work, I cotinue with others changes).

                I create a .js file with the code of quantcast, upload.

                In header template, I add this line:
                Code:
                <script src="https://www.mydomain.com/foro/quantcast.js"></script>
                But not work, not appears the banner consentiment....

                I try the test https://www.w3schools.com/tags/tryit...tml_script_src
                Insert the url of my quantcast.js and not appears any...

                If in this test I add the code of quantcast appears fine.

                Like indicate, I view easy this, but not work....

                Thank yoy very much Wayne!!
                Last edited by gnrx; Sat 11th May '19, 10:19am.

                Comment


                • In Omnibus
                  In Omnibus commented
                  Editing a comment
                  Your JS script code would not ordinarily go in the header. You typically want the other elements of the page to load first. Advertising JS is usually the last thing you want to load so it should go in the footer. JS loads exactly where you place it on the page so if you load it before the container has loaded you will get white space or errors.

                  https://www.w3schools.com/js/js_whereto.asp

              • #9
                In Omnibus
                Yes, also I try to insert the code:
                Code:
                <script src="https://www.mydomain.com/foro/quantcast.js"></script>
                In footer template, but also, the same result...

                I don't know if the code of quantcast are not good for .js file.

                In admincp-forums and blocks and blocks, I can add without problem like html...

                Regards.

                Comment


                • #10
                  I can see the Quantcast banner on your site.
                  Click image for larger version

Name:	2019-05-13_9-28-27.png
Views:	46
Size:	46.6 KB
ID:	4415074

                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                  vBulletin 5 Documentation - Updated every Friday. Report issues here.
                  vBulletin 5 API - Full / Mobile
                  I am not currently available for vB Messenger Chats.

                  Comment


                  • #11
                    However, I was talking about moving the existing code on your site.

                    Like the script tag right under <head> when you View Page Source on your site. This is 5K of inline javascript. The next script block is another 5K of code for Google Ads. And the next 10 lines of code which is another 8K of Javascript. Almost 20K of Javascript trying to manipulate a page that doesn't even exist yet because we haven't even gotten to vBulletin code to render the page.

                    Scroll down a little further and there is 100 lines of inline CSS. This is in itself is excessive. You have a different line of CSS for each of over 100 ad containers to hide them. Instead you should assign a common class to all of these containers and use a single line of CSS to handle the display:none.

                    All of this code is slowing down your site. This is a slowdown, that you can never fix by tweaking the server or upgrading software. It runs on the end user's computer and if they are using an older device then the slowdown can be orders of magnitude higher.

                    Go to your site, right click, and choose View Page Source.
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                    vBulletin 5 Documentation - Updated every Friday. Report issues here.
                    vBulletin 5 API - Full / Mobile
                    I am not currently available for vB Messenger Chats.

                    Comment


                    • #12
                      Originally posted by Wayne Luke View Post
                      I can see the Quantcast banner on your site.
                      Click image for larger version

Name:	2019-05-13_9-28-27.png
Views:	46
Size:	46.6 KB
ID:	4415074
                      It is displayed because, until I can solve it, I inserted the code in admincp-forums-blocks and forums, in a block, that works well for me.
                      If you move through the page to a site where there are no blocks, you can see that in GDPR that appears is not the same, but one by default, because I do not work the script that I added in the <header> and not solve it .
                      Originally posted by Wayne Luke View Post
                      However, I was talking about moving the existing code on your site.
                      Yes, I know but first, I was want start with GDPR

                      Like the script tag right under <head> when you View Page Source on your site. This is 5K of inline javascript. The next script block is another 5K of code for Google Ads. And the next 10 lines of code which is another 8K of Javascript. Almost 20K of Javascript trying to manipulate a page that doesn't even exist yet because we haven't even gotten to vBulletin code to render the page.

                      Scroll down a little further and there is 100 lines of inline CSS. This is in itself is excessive. You have a different line of CSS for each of over 100 ad containers to hide them. Instead you should assign a common class to all of these containers and use a single line of CSS to handle the display:none.
                      Its very javascript...
                      For the Google Ads...I do not really have it set up for Google Ads, it's a monetization company, I have wraped code of the google ads (not added in the header template, but in different templates, like second post, first post ...) and my site goes through its proxy, since the moment I activated this, I noticed a huge slowdown.
                      The theme of Google ads, I do not think I can modify it, the rest yes.

                      All of this code is slowing down your site. This is a slowdown, that you can never fix by tweaking the server or upgrading software. It runs on the end user's computer and if they are using an older device then the slowdown can be orders of magnitude higher.

                      Go to your site, right click, and choose View Page Source.
                      When I go to my site and right click and view source page...ups!!! A lot code javascript....a lot!!

                      First, I go if I can solved the quantcast GDPR, after this, I go to try to solved all this, if I can't and or and I don't know how, I search a person for budget and that can help me.

                      Thanks and regards.

                      Comment


                      • #13
                        vBulletin 5 has GDPR functionality built in. No messing about or trying to figure out where to put things so it doesn't conflict with other JavaScript.
                        Translations provided by Google.

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud customization and demonstration site.
                        vBulletin 5 Documentation - Updated every Friday. Report issues here.
                        vBulletin 5 API - Full / Mobile
                        I am not currently available for vB Messenger Chats.

                        Comment


                        • #14
                          Originally posted by Wayne Luke View Post
                          vBulletin 5 has GDPR functionality built in. No messing about or trying to figure out where to put things so it doesn't conflict with other JavaScript.
                          Thanks Wayne,
                          As you have seen on my site, I have it very personalized, the theme, adons ... etc ... all of them, or most do not think they were compatible with vb 5 ...

                          Comment


                          • #15
                            Some other solution for implementation on vb 4.2?

                            Regards!

                            Comment

                            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                            Working...
                            X