Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

targetingconfig.json issue

ronnyfm
Level 4
Level 4

Hi,

Does anyone know what paths are affected when requesting http://<instance>/content/mysite.targetingconfig.json URL?

I have the same content and code locally and on my development server? However in the dev server I get this exception:

"Unable to load targeting config for page {}".

The message comes from /libs/cq/gui/components/authoring/editors/clientlibs/sites/page.js

$.get(Granite.HTTP.externalize(pagePropsUrl))

  .done(function(data){

  self.forceLocation = data["forceLocation"];

  self.pageAmbits = data["ambits"];

  self.targetingConfigLoaded = true;

  _debug("[TargetedContentManagerUI] Triggering 'target-config-loaded'");

  channel.trigger("target-config-loaded");

  })

  .fail(function(){

  self.targetingConfigLoaded = true;

  _debug("[TargetedContentManagerUI] Could not load config!");

  if (window.console) {

  console.error("Unable to load targeting config for page {}.", pagePropsUrl);

  }

  });

It is a plain GET request. On my local I get an empty JSON or the We Retail campaign info. On my dev server the logs do not throw anything useful. Appreciate the help or hints to find the root cause.

I could suspect of permissions or any other configuration applied there that I do not have on my local, but again, not sure where to begin.

7 Replies
Gaurav-Behl
Community Advisor
Community Advisor

check

  • target cloud config is setup/available properly on that page or not?
  • if the service user has permissions on this bundle assuming that you've followed the same steps in DEV to setup targeting as you had in local?
  • contexthub, targeting and related configurations and code in head.jsp
  • with admin credentials although I doubt that is the issue

Couple of pointers:

config -- com.day.cq.personalization.impl.servlets.TargetingConfigurationServlet in   /system/console/configMgr  to enable to "location"

bundle -- com.day.cq.cq-personalization

service -- com.day.cq.personalization.impl.TargetedContentManagerImpl

Authoring Targeted Content Using Targeting Mode

Developing for Targeted Content

ronnyfm
Level 4
Level 4

Thanks, but we are not using the built-in Target functionality.

ronnyfm
Level 4
Level 4

Additional info:

AEM 6.4.3

The page uses an Editable Template. I have also the same policies applied on both environments.

ronnyfm
Level 4
Level 4

Update: Issue happens using the nosamplecontent, that is the difference between the instances. I am going to setup a nosamplecontent locally to debug further.

Gaurav-Behl
Community Advisor
Community Advisor

that makes me think of core components and contexthub's kernel.js

<script type="text/javascript"src="/etc/clientlibs/foundation/personalization/kernel.js"></script>

Since, you're using OOB engine (and not Target), contexthub kernel js must be loaded.

ronnyfm
Level 4
Level 4

Thanks, I solved by installing 6.4.4 service pack. Still not sure what in the nosamplecontent caused the issue.

ronnyfm
Level 4
Level 4

Not solved in fact. After a restart, the issue comes back. Reproducible at least from 6.4.3 up to 6.5. I am suspecting that I am missing something in the templates, but not sure what yet.