AEM Data Layer installation in AEM weretail site (localhost) | Community
Skip to main content
Level 4
March 27, 2020
Solved

AEM Data Layer installation in AEM weretail site (localhost)

  • March 27, 2020
  • 1 reply
  • 4243 views

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.
Best answer by BrianKasingli

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

1 reply

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
March 27, 2020

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
JayakrishAuthor
Level 4
March 27, 2020
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/