•  · 27 friends

SOLVED: Can’t insert code in head section with injections in Designer

I am trying to insert a script in the head section via injections in Designer.
i already have some code there and sometimes it works sometimes it doesn’t  

now it doesn’t. When I press submit it just returns and when I refresh the code is gone  I have tried to disable all caches, tried different browsers. Same result

Does any of you have an idea of what causes then problem and how to fix it? And is there a manual alternative way of inserting the code while wait for the system to let me do it through injections?

💓0 😆0 😲0 😥0 😠0 0
  • 440
  • More
Replies (9)
    • Maybe it's problem with cache?
      Try clear cache from studio and clear browser cache too

      💓0 😆0 😲0 😥0 😠0 0
      • I already did that. actually disabled it completely. Rebooted computer tried different computers and browsers. Same result

        💓0 😆0 😲0 😥0 😠0 0
        • What the code you try insert through Injections? Can you post code here and I try it on my own UNA installation?


          💓0 😆0 😲0 😥0 😠0 0
          • Sure. It a pixel code for an advertising system. Here it is

            <script type="text/javascript">

                adroll_adv_id = "HYRPSHBSNVDRZGCZ6O32LT";

                adroll_pix_id = "MF5SIIMG6VEGLPSP53EDYE";

                adroll_version = "2.0";


                (function(w, d, e, o, a) {

                    w.__adroll_loaded = true;

                    w.adroll = w.adroll || [];

                    w.adroll.f = [ 'setProperties', 'identify', 'track' ];

                    var roundtripUrl = "https://s.adroll.com/j/" + adroll_adv_id

                            + "/roundtrip.js";

                    for (a = 0; a < w.adroll.f.length; a++) {

                        w.adroll[w.adroll.f[a]] = w.adroll[w.adroll.f[a]] || (function(n) {

                            return function() {

                                w.adroll.push([ n, arguments ])

                            }

                        })(w.adroll.f[a])

                    }


                    e = d.createElement('script');

                    o = d.getElementsByTagName('script')[0];

                    e.async = 1;

                    e.src = roundtripUrl;

                    o.parentNode.insertBefore(e, o);

                })(window, document);

                adroll.track("pageView");

            </script>

            💓0 😆0 😲0 😥0 😠0 0
            • I haven't any idia why it not work. I check that on my UNA and it work properly

              💓0 😆0 😲0 😥0 😠0 0
              • Thank you very much for verifying

                💓0 😆0 😲0 😥0 😠0 0
                • Hello EducatedSingles !

                  Possible, your host has too strict mod_security settings, see example here https://una.io/page/view-discussion?id=4867 

                  💓0 😆0 😲0 😥0 😠0 0
                  • SOLVED: I contacted our hosting provider and they whitelisted mod_security rule

                    Mod_Security is a server-side web application firewall that is designed to block attempts of possibly malicious injections of various snippets into your website scripts; however, in some cases these blocks are false-positive.

                    💓0 😆0 😲0 😥0 😠0 0
                    • You are absolutely right, whitelisting the rule, solved the problem. Thank you

                      💓0 😆0 😲0 😥0 😠0 0
                      Not logged in users can't 'Comments Post'.
                      6
                      1
                      3
                      Added:
                      Category:

                      UNA - Network Infrastructure for Communities

                      Close