Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Client context isn't there + component doesn't show up when dragged and dropped

Avatar

Former Community Member

Hi,

I copied over a website from a co-worker to my CQ instance (5.6.2 I think) and I have the problem that I can neither see the client context (+ shortcut doesn't do anything), nor does the component work that I'm supposed to fix. It shows up in the list but when I drag it onto the page it doesn't show up (it does appear as a JCR node though). Not sure if these problems are even related but I know that both things work on my colleagues machine. 

I realize you guys can probably not help me without further information, but could you tell me a general approach in AEM to tackle these kind of things? Like on machine A it works, on machine B it doesn't. Is there some kind of logs or console etc. I should check? I'm new to this so any help is much appreciated!

Thanks,

Paul

 

// Edit:

I see two js error messages that I think could possibly be related to my client context issue, what do you think?

Uncaught TypeError: undefined is not a function (legacy.js:25)

CQ_Analytics.SessionStore(); --> CQ_Analytics doesn't seem to have this funciton

Uncaught TypeError: Cannot call method 'addListener' of undefined (widgets.js:35)

CQ_Analytics.ClickstreamcloudMgr.addListener --> ​CQ_Analytics.ClickstreamcloudMgr is not defined

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If CQ_Analytics is underfined, it could be only due to missing cq:include of clientcontext

<cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext" />

But I see that it is being included in the body.jsp. 

I hope it is the first line just after your <body> tag and your cloud services include is the last line before </body> tag of your page component.

Please throw some light on what is returned undefined. Is it the CQ_Analytics or something else?

If nothing works out, I would recommend that you re-install your author instance afresh or package '/libs/cq/personalization/components/clientcontext' from an instance where it works fine and install it in your instance.

View solution in original post

9 Replies

Avatar

Level 10

Seems like required client libs are not included. If repository is small then compare using [1] & the difference will help to find the cause.

[1]  http://helpx.adobe.com/experience-manager/kb/contentcompareimport.html

Avatar

Level 7

Yes, there is a missing "include" or import of the necessary libraries and those js errors will surely prevent the client context from showing up. 
How did you go about copying the site, did you get all the clientlib configurations right? There might also be something else (js-related, maybe your own js files) that is causing those libraries to fail loading. Are there any traces in the actualy log files of the error or is those two lines in the web console the only thing you get ?

Also a last question, are both the analytics and clientcontext still included on your page?

/Johan

Avatar

Former Community Member

Thanks Sham HC for the link, that really did get rid of that particular error in the logs.

 

@Johan:

I basically imported a ZIP package and installed it, didn't modify the clientlib configuration at all. 

Those javascript errors (see initial post) are the only ones I get. When I add ?debugClientLibs=true to the URL it's these:

  1. Uncaught TypeError: undefined is not a function twitterprofiledata.js:25
  1. Uncaught TypeError: undefined is not a function fbprofiledata.js:25
  1. Uncaught TypeError: undefined is not a function fbinterests.js:22
  1. Uncaught TypeError: Cannot call method 'addListener' of undefined twitterprofiledata.js:23
  1. Uncaught TypeError: Cannot call method 'addListener' of undefined ClickstreamStore.js:10

I honestly don't have a good idea of where to even start looking for the missing includes. It looks like the 'CQ_Analytics' isn't fully included.

Not sure I understand your last question, but as far as I can see it's still included. This is from the body.jsp:

<!-- to use SITECATALYST --> <cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext"/> <cq:include script="header.jsp"/> <cq:include script="content.jsp"/> <cq:include script="footer.jsp"/> <!-- to use SITECATALYST --> <cq:include path="cloudservices" resourceType="cq/cloudserviceconfigs/components/servicecomponents"/> <cq:include script="footlibs.jsp"/>

Thanks!

Paul

Avatar

Former Community Member

Thanks! That tool seems helpful, although our repository might be a little big to compare in total.

As for the missing client libs, I can see we include the Sitecatalyst libs as described in the docs (http://dev.day.com/docs/en/cq/current/administering/integrating_with_adobe_marketing_cloud/sitecatal...). Would it also show that error if I'm missing a Sitecatalyst configuration? (because I do...)

The logs show a lot of errors like this:

*ERROR* [pool-5-thread-2] com.day.cq.analytics.sitecatalyst.ImpressionsImporter SiteCatalyst configuration not found

Avatar

Correct answer by
Former Community Member

If CQ_Analytics is underfined, it could be only due to missing cq:include of clientcontext

<cq:include path="clientcontext" resourceType="cq/personalization/components/clientcontext" />

But I see that it is being included in the body.jsp. 

I hope it is the first line just after your <body> tag and your cloud services include is the last line before </body> tag of your page component.

Please throw some light on what is returned undefined. Is it the CQ_Analytics or something else?

If nothing works out, I would recommend that you re-install your author instance afresh or package '/libs/cq/personalization/components/clientcontext' from an instance where it works fine and install it in your instance.

Avatar

Former Community Member

OK, now I actually got the Client Context to work. What I did is import/install all the packages I got from my colleague and then import the libs/cq/personalization on top of that. I noticed that one of the packages I received causes the error and even caused the CC to fail for the Geometrixx page. Still didn't figure out which particular part/line causes it to crash part something must have been overwritten.

As for the second part of my problem, the component I want to modify, it still doesn't show up when I drag it onto the page.

Avatar

Level 7

A great that you solved the first part.
About the 2nd part, what does the error log say ? 

Avatar

Former Community Member

Mm, it actually didn't say anything that I think was related to the issue. Just a bunch of *INFO* and not even remotely related *ERROR* messages.

Anyway, this issue can be closed. I'm building the component from scratch now on the Geometrixx site where I know it works. We'll port it over to the actual system when I actually get a working copy. 

Thanks everybody for the help!

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----