4 Replies Latest reply on Mar 20, 2012 7:04 AM by mike_ottinger

    Can I disable the SiteCatalyst static variables in the /libs/cq/analytics/widgets code?

    daniel_e_leong

      Hello,

       

      We are having serious problems with a installation of the tracking integration in CQ 5.4

       

      Whenever we load the Page Properties dialog in the CQ5 WCM interface, it creates a lot of hidden form fields for the jcr:content/analytics/cq:variables property, and these get filled in with a lot of "junk". Every time we save the page this seem to double in size! We're loading some of these pages in publish with .json calls which means that very quickly we end up with 2-10MB HTTP GET requests

       

      The data in the JCR starts to look like this :-

      <analytics cq:variables="[\,\,\,\,\,\,\,\,[&quot;charSet&quot;\,&quot;UTF-8&quot;]\,[&quot;cookieLife time&quot;\,&quot;&quot;]\,[&quot;currencyCode&quot;\,&quot;USD&quot;]\,[&quot;trackInline &quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;charSet&quot;\,&quot;UTF-8&quot;]\,[&quot;co okieLifetime&quot;\,&quot;&quot;]\,[&quot;currencyCode&quot;\,&quot;USD&quot;]\,[&quot;tra ckInline&quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;charSet&quot;\,&quot;UTF-8&quot;]\,[ &quot;cookieLifetime&quot;\,&quot;&quot;]\,[&quot;currencyCode&quot;\,&quot;USD&quot;]\,[& quot;trackInline&quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;charSet&quot;\,&quot;UTF-8&q uot;]\,[&quot;cookieLifetime&quot;\,&quot;&quot;]\,[&quot;currencyCode&quot;\,&quot;USD&qu ot;]\,[&quot;trackInline&quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;charSet&quot;\,&quot ;UTF-8&quot;]\,[&quot;cookieLifetime&quot;\,&quot;&quot;]\,[&quot;currencyCode&quot;\,&quo t;USD&quot;]\,[&quot;trackInline&quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;charSet&quot ;\,&quot;UTF-8&quot;]\,[&quot;cookieLifetime&quot;\,&quot;&quot;]\,[&quot;currencyCode&quo t;\,&quot;USD&quot;]\,[&quot;trackInline&quot;\,&quot;&quot;]\,\,\,\,\,\,\,\,\,[&quot;char Set&quot;\,&quot;UTF-  etc...

       

      We've tracked (no pun intended) this down to the file /libs/cq/analytics/widgets/source/sitecatalyst.js and are wondering if we can comment out from around line 30 :-

      ........

                   for(var i=0; i<variableDefaults.length; i++) {

                       dlg.formPanel.add(new CQ.Ext.form.Hidden({

                           name:'./analytics/cq:variables',

                           value: CQ.Ext.util.JSON.encode(variableDefaults[i])

                       }));

                   }

      ........

      And at line 80:

              setValue("cq:variables", parentConfig["cq:variables"]);

       

      This should prevent these fields in the Page Properties dialog from ever appearing (as far as we can tell).

      1. Does anyone know if there's any other dependencies on this?
      2. Are there any side-effects to what we propose?
      3. And has anyone else ever seen the crazy values appear as above?

       

      [edit] (This has also been raised in Daycare 32510)

       

      Thanks for any advice,

       

      Dan Leong

        • 1. Re: Can I disable the SiteCatalyst static variables in the /libs/cq/analytics/widgets code?
          Roland Schär

          Hi Dan,

           

          to answer your questions:

          1. The cq:variables are finally written out to the page source in /libs/cq/analytics/components/analytics/sitecatalyst.jsp. If there are no defaults nothing is written and this should not have any impact.

          2. No. cq:variables is used as a default for generally used s_code properties like currency and the such.

          3. Until now we could not reproduce this behavior on a plain 5.4 installation with HF34667 and FP35720 applied. Is there anything we should consider trying, deep inheritance for instance?

           

          - Roland

          1 person found this helpful
          • 2. Re: Can I disable the SiteCatalyst static variables in the /libs/cq/analytics/widgets code?
            mike_ottinger

            So to add a little more context to this issue. Further investigation (we're working with Dan Leong on this issue) has been done. We're suspecting a possible explanation for the extraneous junk data is the fact that when page properties are rendered, multiple instantiations occur for the same tabs. We've seen that in cases where the nodes do inherit analytics correctly, there is an identical number of sitecatalyst-related (eg jcr:content.sitecatalyst.json) calls made as compared to other json calls (such as pageinfo.json). In scenarios where the analytics are NOT inherited correctly, there's a mismatch in these calls. We'll see the repeated calls for other *.json requests, but we'll only see the jcr:content.sitecatalyst.json call once.

             

            The question we have is why are there repeated calls for the same json requested when showing a page properties dialog? Could this be a possible factor that contributes to this. We also think the repeated calls are responsible for slow rendering times of the page properties dialog.

            • 3. Re: Can I disable the SiteCatalyst static variables in the /libs/cq/analytics/widgets code?
              Roland Schär Level 1

              Hi Mike,

               

              thank you for your more detailed explanation. I will open a bug for this and will investigate this further as soon as we can reproduce this issue in any way. An OOTB installation does not show this issue in our environment.

              • 4. Re: Can I disable the SiteCatalyst static variables in the /libs/cq/analytics/widgets code?
                mike_ottinger Level 1

                Thanks Roland,

                 

                  To give you more information. We discovered the source of the multiple instantiations of tabs from the page properties. We have a listener on the dialog.xml for our pages that listens for loadcontent events. In the course of its logic, the javascript for this listener will invoke dialog.loadContent(path) itself. Thus the double calls. Strictly speaking, we could look at ways to avoid the use of the loadContent call. But we also feel that there is something going on with regards to siteCatalyst and double-loading. This might be something you'll want to incorporate in your efforts to reproduce this. For posterity, here's a sample listener definition in our dialog.xml

                 

                <listeners

                        jcr:primaryType="nt:unstructured"

                        loadcontent="function(dialog, records, opts, success) {CQ.Acme.populateShortURL(dialog, records, opts, success);}"/>

                 

                Hope this helps!