AEM integration with Adobe Analytics - not working/tracking in Publisher | Community
Skip to main content
New Participant
November 25, 2015
Solved

AEM integration with Adobe Analytics - not working/tracking in Publisher

  • November 25, 2015
  • 4 replies
  • 2517 views

Hi,

   We have integrated AEM with Adobe Analytics. The integration is working in author instance and we are able to capture the tracking information when we access a page(say /content/en/sample)  using Adobe DigitalPulse Debugger tool.

The configuration and pages are published/installed in publisher instance successfully.

But the same integration is not working in publisher instance and tracking is not happening.

When we access the page enabled for tracking in publisher, we can see the below required analytics scripts loaded.

<script type="text/javascript" src="/etc/clientlibs/foundation/sitecatalyst/sitecatalyst.min.js"></script>
 <script type="text/javascript" src="/etc/clientlibs/foundation/sitecatalyst/util.min.js"></script>
 <script type="text/javascript" src="/content/sample/dfssdsdsds991232cdfd9991/pdf/_jcr_content/analytics.sitecatalyst.js"></script>
 <script type="text/javascript" src="/etc/clientlibs/foundation/sitecatalyst/plugins.min.js"></script>

And below the above script tags, we can see inline analytics script which maps cq variables to site catalyst variables.

CQ_Analytics.Sitecatalyst.updateEvars = function(options) {
     this.frameworkMappings = [];


 // code for mapping cq variables to sc variables


     for (var i=0; i<this.frameworkMappings.length; i++){
   var m = this.frameworkMappings[i];
   if (!options || options.compatibility || (options.componentPath == m.resourceType)) {
    CQ_Analytics.Sitecatalyst.setEvar(m);
   }
     }
 }

But tracking is not happening. In Browser console we can see below JAVASCRIPT errors

Uncaught ReferenceError: CQ_Analytics is not defined

 

Please let us know, any other specific configuration is required in Publisher instance.

 

Regards

Sreeni

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

We still have same documentation for 6.1.

Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/extending/sitecatalyst/sc-components.html

//

The clientcontext script that you insert after the body element adds the Client Context features to the page.

The cloudservices script that you add before the body end element applies to the cloud services configurations that are added to the page. (If the page uses more than one Cloud Services configuration, you need to include the ClientContext jsp and the Cloud Services jsp only once.)

I hope this would help you.

Thanks and Regards

Kautuk Sahni

4 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
November 30, 2015

Hi 

We still have same documentation for 6.1.

Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/extending/sitecatalyst/sc-components.html

//

The clientcontext script that you insert after the body element adds the Client Context features to the page.

The cloudservices script that you add before the body end element applies to the cloud services configurations that are added to the page. (If the page uses more than one Cloud Services configuration, you need to include the ClientContext jsp and the Cloud Services jsp only once.)

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
user00725Author
New Participant
November 27, 2015

Thanks for your quick reply!!

Now AEM integration with Adobe Analytics is successful and tracking is happening in all the pages (parent/child) both in author and publisher with the inclusion of the below scripts in our base component body.html


<div data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}"> </div>
<div data-sly-resource="${ @path='cloudservices', resourceType='cq/cloudserviceconfigs/components/servicecomponents'}"> </div>

Only the AEM 5.6 documentation(https://docs.adobe.com/docs/en/cq/5-6/administering/integrating_with_adobe_marketing_cloud/sitecatalyst.html ) suggests to include these scripts, not  AEM 6 and 6.1.


Please let us know the side effects of including them in AEM 6 and also explain the need of these scripts and any alternative.

 

Thanks in Advance
Sreeni

kautuk_sahni
Employee
November 26, 2015

Hi 

Quick try can be done to check if things works:-

1. https://docs.adobe.com/content/docs/en/cq/5-6-1/administering/integrating_with_adobe_marketing_cloud/sitecatalyst.html#par_title_4

//

For the Report Suite ID (RSID) that you are using, you can control which server instances (author, publish, or both) contribute data to the Report Suite:

  • All: Information from both the author and the publish instance populates the Report Suite.
  • Author: Only information from the author instance populates the Report Suite.
  • Publish: Only information from the publish instance populates the Report Suite.

2. Troubleshooting :- https://helpx.adobe.com/experience-manager/kb/sitecatalystintegrationtroubleshooting.html

I hope this would help. And yes as mentioned by Scott, Make sure that you have both instances setup the same way.

 

I hope this would come as some help to you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
smacdonald2008
New Participant
November 25, 2015

Have you setup the exact Cloud Configuration on the Pub instance that you have on Author instance. Make sure that you have both instances setup the same way.