Access member information from your JavaScript code snippets
Last updated: January 29, 2025
Analytics scripts often require you to pass a currently signed-in member's information inside their JavaScript code snippet.
We've added a global window.circleUser object for this purpose, which makes the following information accessible from your custom code snippet:
email
name
firstName
lastName
isAdmin (true/false)
isModerator (true/false)
location
profileUrl
publicUid (the member's unique Circle ID)
linkedinUrl
twitterUrl
facebookUrl
websiteUrl
An example of how you would use this data inside an identify() call:
FS.identify(circleUser.publicUid, {
displayName: circleUser.name,
email: circleUser.email,
isAdmin: circleUser.isAdmin,
profileUrl: circleUser.profileUrl
});
To add custom JavaScript and CSS code inside the <head> section in your community:
Click your community name or logo—or the dropdown icon next to it—in the top-left of the navigation header and select Site.
From the sidebar menu, select Code snippets.