Skip to main content
Level 3
Aug 24, 2016 5:40 PM UTC
Solved

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

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.
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Aug 29, 2016 12:31 PM UTC

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

4 replies

Level 3
Aug 29, 2016 11:24 AM UTC

Hi,

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

Thank you in advance!

Translate
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Aug 29, 2016 12:31 PM UTC

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

Translate
Kautuk Sahni
Level 3
Aug 29, 2016 3:07 PM UTC

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.

Translate
Level 3
Aug 30, 2016 1:36 AM UTC

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

Thank you.

Translate