Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Sidekick components is empty, javascript error: campaigns undefined

Avatar

Level 3

Hello,

I have a site that is not showing any components on the sidekick. However if I right click on the desired parsys and press new I see the expected components. I've search for solutions and came to the conclusion that the problem is a javascript error.

When rendering the page in the console I see:

Uncaught TypeError: Cannot read property 'campaigns' of undefined CQ.personalization.TargetEditor.render @ widgets.js:1926 CQ.personalization.TargetEditor @ widgets.js:1453 CQ.personalization.TargetEditor.get @ widgets.js:2475 data.(anonymous function) @ VM58288:1 CQ.utils.Util.addListenerToConfig.obj.listeners.(anonymous function) @ widgets.js:88624 EXTUTIL.Event.fire @ widgets.js:4776 EXTUTIL.Observable.fireEvent @ widgets.js:4417 CQ.wcm.EditRollover.CQ.Ext.extend.buildElement @ widgets.js:150548(anonymous function) @ widgets.js:2281

As far as I know there isn't any special configuration regarding campaigns or personalization. 

Using CQ 5.6.1 sp2

Any suggestions?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

target is the the personalization component. so there should be a component which is targeted to a specific campaign. which ever node has that resourceType is the component which is targetted. if you remove that it should work.

or you can see what is that campaign mapped to and check on the specification of that campaign

View solution in original post

8 Replies

Avatar

Level 10

sound like you have wrong mapping of segments in campaign.  Delete the campaign & recreate with adding experience.

Avatar

Level 10

is it happening only for your site or all other sites like geometrixx aswell ?

Avatar

Employee

Hi Frederico,

are you using the client context/personalisation features? 

You can remove it by commenting out the code below in the appropriate JSP. Or add it, if the code is not there and see if this resolves your issue. 

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

Regards,

Opkar

Avatar

Level 3

Only for my site and actually not to all pages. The ones where the sidekick works don't have this js error.

Avatar

Level 3

Thank you both for the answers. For now seems these components where not meant to be used, since there was no campaign tracking anything, so removing them fixed the problem. 

Avatar

Level 3

I'll definitely try this, but it sounds like something is wrong in some of my pages, or that some specific campaign/segment/something is pointing to some of my pages. Do you know if there's a way / place to check for this? I couldn't find any node or property related to this on the content pages themselves.

Avatar

Level 3

So, I've tried searching around the existing campaings, but there aren't any specific ones for my site.

I did find something interesting in the code. Failing pages have (xxx = content removed): 

<script type="text/javascript"> $CQ(function() { CQ_Analytics.Engine.loadTeaser({ targetID: "_xxx-jp_ja_jp_products_allproducts_xxx_jcr_content_container_columns_control_0_item-two_title", teasers: [{"path":"/content/xxx-jp/ja_jp/products/allproducts/xxx/jcr:content/container/columns_control_0/item-two/title/default","url":"/content/xxx/ja_jp/products/allproducts/xxx/jcr:content/container/columns_control_0/item-two/title.default.html","name":"default","title":"Default","campainName":"","thumbnail":"/content/xxx/ja_jp/products/allproducts/xxx/jcr:content/container/columns_control_0/item-two/title.thumb.png"}], strategy: "", trackingURL: "http://localhost:4502/libs/wcm/stats/tracker"}); }); </script>

If I remove this node /content/xxx/ja_jp/products/allproducts/xxx/jcr:content/container/columns_control_0/item-two or rename it the sidekick shows as expected. However I can't find anything in this or the contained node that produces any campaign reference. 

Any suggestions on where to look?

UPDATE: ok, there's a node of sling:resourceType = cq/personalization/components/target which is the problematic one. Still not sure what this means though.

Avatar

Correct answer by
Level 10

target is the the personalization component. so there should be a component which is targeted to a specific campaign. which ever node has that resourceType is the component which is targetted. if you remove that it should work.

or you can see what is that campaign mapped to and check on the specification of that campaign