Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adobe Experience Cloud without AEM | Datalayer component
import React from 'react';
export default class DataLayer extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<></>
)
}
componentDidMount() {
const { pageTitle, pageType, pagePath } = this.props;
{
window.digitalData = {
page: {
pageInfo: {
pageName: pageTitle,
pageType: pageType,
pagePath: pagePath
}
}
}
var event = new CustomEvent('datalayer-complete');
var obj = document.querySelector("body");
obj.dispatchEvent(event);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.