AEM Data Layer installation in AEM weretail site (localhost) | Community
Skip to main content
Level 4
Mar 27, 2020 7:55 AM UTC
Solved

AEM Data Layer installation in AEM weretail site (localhost)

Team,

 

I am looking forward to install AEM data layer for my local instance which is http://localhost:4502/sites.html/content/we-retail . So that the way and method of getting data to anaytics will make site easier and standard. Basically I am a analytics guy and not aware much on this data layer installation process. Please assit me with below.

 

1. Could you please tell me where can I get my AEM data layer packages from adobe?

2. Also, send me some docs or steps to be followed to install in my local host.

 

Thank you!!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
BrianKasingli
BrianKasingliAccepted solution
New Participant
Mar 27, 2020 10:35 AM UTC

Hi @jayakrish ,

A data layer is a framework of JavaScript objects on your site that contains all variable values used in your implementation. It allows greater control and easier maintenance in your implementation. These JavaScript objects interact with Adobe Analytics.
Setup can be done as simple as adding code within your basePage template, right before the </body> as such:

 

<script data-sly-use.digitalDataLayer="my.package.DigitalDataLayer"> (function () { var digitalDataLayer = { environment: { environmentVersion: '${digitalDataLayer.environmentVersion @ context='scriptString'}', environmentName: '${digitalDataLayer.environmentName @ context='scriptString'}', siteName: '${digitalDataLayer.siteName @ context='scriptString'}', statusCode: '${digitalDataLayer.statusCode @ context='scriptString'}' }, target: {}, page: { pageInfo: { pageName: '${currentPage.name @ context='scriptString'}', pageReferrer: document.referrer, pageSiteSubsection: '${digitalDataLayer.pageSiteSubsection @ context='scriptString'}', pageType: '${pageProperties.pageType @ context='scriptString'}', pageURL: window.location.href } } } }()); </script>

 

Example: View Page Source, and go to the bottom of the HTML document: https://www.rolex.com
Documentation: https://docs.adobe.com/content/help/en/analytics/implementation/prepare/data-layer.html

3 replies

BrianKasingli
BrianKasingliAccepted solution
New Participant
Mar 27, 2020 10:35 AM UTC

Hi @jayakrish ,

A data layer is a framework of JavaScript objects on your site that contains all variable values used in your implementation. It allows greater control and easier maintenance in your implementation. These JavaScript objects interact with Adobe Analytics.
Setup can be done as simple as adding code within your basePage template, right before the </body> as such:

 

<script data-sly-use.digitalDataLayer="my.package.DigitalDataLayer"> (function () { var digitalDataLayer = { environment: { environmentVersion: '${digitalDataLayer.environmentVersion @ context='scriptString'}', environmentName: '${digitalDataLayer.environmentName @ context='scriptString'}', siteName: '${digitalDataLayer.siteName @ context='scriptString'}', statusCode: '${digitalDataLayer.statusCode @ context='scriptString'}' }, target: {}, page: { pageInfo: { pageName: '${currentPage.name @ context='scriptString'}', pageReferrer: document.referrer, pageSiteSubsection: '${digitalDataLayer.pageSiteSubsection @ context='scriptString'}', pageType: '${pageProperties.pageType @ context='scriptString'}', pageURL: window.location.href } } } }()); </script>

 

Example: View Page Source, and go to the bottom of the HTML document: https://www.rolex.com
Documentation: https://docs.adobe.com/content/help/en/analytics/implementation/prepare/data-layer.html
Translate
JayakrishAuthor
Level 4
Mar 27, 2020 3:35 PM UTC
Hi, thanks for your reply. I am aware about the data layer and its usage across the analytics and web site. However, I am looking to host the AEM data layer under my local host 4502 (we retail) instance. Please refer the link for reference. I am looking to host the data layer on the same method. Would be good if you guide me to install on the same method. Where can I download those package and how to proceed further? https://blogs.adobe.com/contentmanagement/2017/04/18/be-an-aemrockstar-use-aem-datalayer/
Translate