Skip to main content

I am having issues setting up Intercom with the Google tag manager on my NextJS web application. I am using the react-gtm-module as well.
When I don’t set any dataLayer variables or when I am logged out of my application, the default home screen loads. However, when I am logged in I am pushing user data to the dataLayer and using it as variables for the Google Tag.

In my _app.tsx, I have this code
 

This is global and is what is initializing the Intercom messenger that works when not logged in.
Further along my application structure, I have an auth provider using next-auth that returns different components based off log in status. 
 

This fires when the session changes and passes in null when the user is not logged in.
However, when I preview and the user is logged in and I open the messenger, this is all I get:
 

The messages section seems to be working fine.

I have two tags set up in GTM, one for install and one for update. Here’s how those are configured:
Install:

Update:

All of the data attributes are dataLayer variables. 
In the debug setting during GTM preview, the update fires and I have access to all these variables.

Most of our stuff is proprietary so I am not sure how much more I can provide, I would appreciate all the help I can get.

 

Hey @Daniel Scroggins Racheal from the support engineer team here👋 

 

I can see you already have an open conversation with the team, since we don’t want to share any of your sensitive data over the community here we’ll let one of my teammates jump in to help you out then I’ll update this thread with any relevant, general information.

 

One of my teammates will be reaching out soon!


Reply