Highlighted

targetingconfig.json issue

ronnyfm

24-04-2019

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.

Replies

Highlighted

Gaurav-Behl

MVP

24-04-2019

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

Highlighted

ronnyfm

24-04-2019

Additional info:

AEM 6.4.3

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

Highlighted

ronnyfm

25-04-2019

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

Highlighted

Gaurav-Behl

MVP

25-04-2019

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.

Highlighted

ronnyfm

25-04-2019

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

Highlighted

ronnyfm

22-05-2019

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.