Adobe Analytics - Track user logged in status without Data Layer

Bronze Contributor
Bronze Contributor

Hi,

My application does not have data layer in place. I am trying to capture user logged in status based on visibility of "logout" button which is persistent in sidebar navigation throughout application. I tried creating javascript extension with below code using jquery selector but it isn't resulting in any output. It is running fine on  chrome developer console. Can anyone please suggest a solution to this. I can try using Jquery on handler with "show" setting but i don't want additional calls to fire on the page.

scLinkCustVars = 'prop12';
if($("#page-header-container > div > div.top-nav-right > ul > li:nth-child(6) > a").hasClass("logout")) {
s.prop12 = "logged in";
} else {
s.prop12 = "logged out";
}
3 REPLIES 3

Adobe Analytics - Track user logged in status without Data Layer

Tealium Expert
Tealium Expert
Hi

If the jquery and if statement are working, then it may be the case that ratehr than feed the status directly to the CustVars. Feed it to a datalayer var instead that is mapped to the respective var in the tag.

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -

Adobe Analytics - Track user logged in status without Data Layer

Bronze Contributor
Bronze Contributor
Hi @GavinAttard,
Thanks for your quick response!
Issue has been resolved. I created UDO variable in Data Layer and assigned it value in Javascript using b object. After mapping it with corresponding variable in Adobe Analytics, I was able to receive desired outcome. Again thanks for your help!

Adobe Analytics - Track user logged in status without Data Layer

Tealium Expert
Tealium Expert

You are welcome @Isha_Gupta 

If you would be so kind so as to mark it as solution if it fit the bill. 

Thanks. 

 

Research your Experience | Improve and Evolve | Leave no one behind
- Don't forget to mark a solution as accepted if it hits the mark -
Public