View as published option in AEM 6.2 author instance includes Production DTM JS Library | Community
Skip to main content
Level 3
August 24, 2016
Solved

View as published option in AEM 6.2 author instance includes Production DTM JS Library

  • August 24, 2016
  • 4 replies
  • 2936 views

Hi,

We have noticed that View as published option in AEM 6.2 author instance includes Production DTM script (instead of Staging DTM Script), which affects Analytics Report (since analytics data is also coming from author instance). How can we rectify this issue since all the DTM rules are getting fired from 'View as Published' option in author instance and sending data to Production Report?

Kindly refer below screen shot :

Your immediate response is much appreciated.

Thank you.

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 

I have checked the behavior you just have mentioned.

When configuring DTM cloud service  we have un-checked "Include Production Code on Author" so in theory AEM authoring should use staging data.

So when we select preview mode, it only triggers Staging script but when we click on "View as published" it adds "?wcmmode=disabled" to the URL and the production scripts getting triggered.

I am not sure if this is a correct behavior or not, may be when we do "View as published" we have imitating full production view.

 

Workaround:- In DTM,

1. Select your property

2. Go to Analytic tool settings

3. Go to "Customize Page Code" (Select After UI settings (custom code takes precedence)) Here write a logic to check if URL of page (windows.location.href) is of Author instance then set "s.account="Staging report suit". This will make sure that data from authoring instance would never goes to production server. 

 

I hope this helps.

Thanks and Regards

Kautuk Sahni

4 replies

Level 3
August 29, 2016

Hi,

Just wanted to check if we have any update on this ?

Thank you in advance!

kautuk_sahni
Community Manager
kautuk_sahniCommunity ManagerAccepted solution
Community Manager
August 29, 2016

Hi 

I have checked the behavior you just have mentioned.

When configuring DTM cloud service  we have un-checked "Include Production Code on Author" so in theory AEM authoring should use staging data.

So when we select preview mode, it only triggers Staging script but when we click on "View as published" it adds "?wcmmode=disabled" to the URL and the production scripts getting triggered.

I am not sure if this is a correct behavior or not, may be when we do "View as published" we have imitating full production view.

 

Workaround:- In DTM,

1. Select your property

2. Go to Analytic tool settings

3. Go to "Customize Page Code" (Select After UI settings (custom code takes precedence)) Here write a logic to check if URL of page (windows.location.href) is of Author instance then set "s.account="Staging report suit". This will make sure that data from authoring instance would never goes to production server. 

 

I hope this helps.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Level 3
August 29, 2016

Hi Kautuk,

Thank you for your suggestion. However this doesn't resolve the issue. I can still see, production report suite is getting triggered on author URL with '?wcmmode=disabled'. :(

For testing purpose, I just put s.account="report-suite-id"; under Customize Page Code in DTM and I can see the mentioned report suite Id is not getting triggered anywhere.

Please let me know if anything else can be done.

Level 3
August 30, 2016

It worked for me after I published the changes for Analytics tool changes in DTM.

Thank you.