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

api.get.user_email does not work with non-workspace email addresses #786

Open
DDorrance90 opened this issue Mar 18, 2024 · 0 comments
Open

Comments

@DDorrance90
Copy link

As explained in this comment: #779 (comment)

It seems that the error occurs with personal accounts: @gmail.com, with professional accounts it works correctly.

To fix this error, add these instructions:

if(api.tracker.globals.length == 0 && GLOBALS !== "undefined" && GLOBALS.length > 11)
     api.tracker.globals = GLOBALS;

to the function: api.get.user_email

api.get.user_email = function() {
  if(api.tracker.globals.length == 0 && GLOBALS !== "undefined" && GLOBALS.length > 11)
    api.tracker.globals = GLOBALS;
		
  let user_email = api.tracker.globals[10];	  

  if (user_email) {
    return user_email;
  }
  const elements = document.getElementsByClassName("eYSAde");
  for (const el of elements) {
    if (el.innerHTML.indexOf("@") === -1) {
      return el.innerHTML;
    }
  }
      return null;
};

Location: api.get.user_email

There is a simple fix explained in the comment that worked for me. Just wanted to make a separate issue to make sure this doesn't fall through the cracks 😉

Problem

The api.get.user_email method always returns null

Testing Conditions

Problem can only be reproduced by using a gmail account ending in @gmail.com.

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

1 participant