Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataLayer is not defined #4

Closed
acamenhas opened this issue Dec 16, 2017 · 1 comment
Closed

dataLayer is not defined #4

acamenhas opened this issue Dec 16, 2017 · 1 comment

Comments

@acamenhas
Copy link

acamenhas commented Dec 16, 2017

Hi!
I've made the following setup:

a) in the "routes" component i put:

import TagManager from "react-gtm-module";

const tagManagerArgs = {
    gtmId: "GTM-xxxxxxx",
    dataLayerName: "PageDataLayer"
}
TagManager.initialize(tagManagerArgs);

ReactDOM.render(
    <BrowserRouter>
        <Provider store={Store}>
            <ResolutionRoute />
        </Provider>
    </BrowserRouter>,
    document.getElementById("root")
);

b) and in a view component:

const tagManagerArgs = {
    dataLayer: {
        userId: "001",
        userProject: "project",
        page: "home2
    },
    dataLayerName: "PageDataLayer"
}

class Login extends React.Component {...
    componentDidMount() {
    ...
    TagManager.dataLayer(tagManagerArgs);
   ...

But i have the error "Uncaught ReferenceError: dataLayer is not defined" in my console, can you help me?

Regards

@alinemorelli
Copy link
Owner

Fixed on #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants