Forum Discussion

MarkSchwanke's avatar
3 years ago

How to identify SSO ID for Digital Adoption Platform?

 

<script>
window.Appcues.identify(
  "<<< USER_ID >>>", // unique, required
  {

    // recommended (optional) properties

    createdAt: 1566932390, // Unix timestamp of user signup date
    purchasedAd: 1566932395, // Unix timestamp of account purchase date (leave null if empty)
    planTier: "Standard", // Current user’s plan tier
    role: "Admin", // Current user’s role or permissions
    accountId: "1234", // Current user's account ID
    firstName: "John", // current user's first name

    // additional suggestions

    companyName: "Acme Corp", // Current user’s company name
    email: "john.doe@example.com", // Current user's email
    location: "90210", // a zipcode, state, or country enables location-based targeting
    version: "2.0", // users on different versions may need to see different content
    language: "spanish", // for multi-language applications
    renewalDate: 1577880288 // to remind users to renew
  }
);
</script>

I'm looking to add a Digital Engagement Platform via JavaScript on to my community. In order to track users we need to provide a unique identifier for each user. 

I've copied the sample script from their website and they identify what is supposed to be swapped out.

However I'm having trouble identifying what should be used for the SSO ID value in the sample code above in place of "<<< USER_ID >>>"

 

After the correct syntax is determined I also need to ensure it is being placed in the right place  in Stuido > Community Style > Wrapper > Custom Skin.

 

Any other information on how I can identify other fields would be helpful as well.

For example we might like to do the following.

  • Trigger at number of visits
  • Trigger # of days after account creation date
  • Trigger at specific Rank
  • Trigger with specific Roles
  • Trigger for sponsor status
  • Trigger for certain companies
  • Trigger if custom date is Today
  • Trigger for certain languages

From Page Hitbox I'm seeing:

standard fields: 
<#assign khorosUserID = user.id />
<#assign communityUsername = user.login />
<#assign emailAddress = user.email />


We also have some custom fields 

<#assign quitDate = user.get("profile.quitDate")!"No quit date selected" />
<#assign payerInfo = user.get("profile.company.name")!"" />
<#assign eligibleForNRT = user.get("profile.nrt")!"false" />
<#assign personID = restadmin("/users/id/${user.id}/sso_id").value!"" />
<#assign sponsoredStatus = user.get("profile.sponsored.status")!"" />
<#assign language = user.get("profile.language")!"" />

I do also see in the hitbox

personID = '${personID}';

Hopefully someone can point me in the right direction so I can learn this a little better and expand upon it.

TIA

 

 

  • I heard back from my CSM. So it turns out that if I use ${user.ssoId} it will work for AppCues, and possibly other Digital Adoption Platforms in the Page Head bottom Content of the Community Wrapper.  It's important to use an uppercase I in Id as ${user.ssoid} will result in errors.

    <script>
    window.Appcues.identify(
      ${user.ssoId},  // unique, required
      {
    
      }
    );
    </script>
    
    <script>

     

  • MarkSchwanke,

    personID = '${personID}'; should be the unique id, You can use user-id or email any of them.
    There is no justification for this, but this should be unique.

    Mostly companies used SSO-id for internal and for security purpose. For Security and best practices around this should not be shared over browsers or can not be visible while viewing the source code and should be avoid to share it to track with anyone or third party tools for users.

    So its better to use ${user.id}.

    Also do add your code inside user login condition, so this will not pass empty values when there is an anonymous users browsing into the community.

    <#if user.anonymous == false && user.registration.complete == false >
    write your script code here
    </#if>
    • MarkSchwanke's avatar
      MarkSchwanke
      Boss

      Parshant Thanks I did try ${user.id} and it did work and pulls in the Khoros ID as expected. 

      I appreciate the warning about the SSO ID and will discuss with our security person.

      I couldn't get it to pull in the SSO ID though so something must not be right with my syntax still.  Looks to be that when I'm logged in to admin account and bypassing the SSO login and no SSO login exists it doesn't like it and gives me this error (See below) so I need to figure out what the default value should be when admins and support are logged in but don't have an SSO ID so I can avoid sending them on walk throughs but still have that distinct from someone who is guest browsing who we do want to get prompted by DAP.

      ----
      Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
      ----

       

    • MarkSchwanke's avatar
      MarkSchwanke
      Boss

      I heard back from my CSM. So it turns out that if I use ${user.ssoId} it will work for AppCues, and possibly other Digital Adoption Platforms in the Page Head bottom Content of the Community Wrapper.  It's important to use an uppercase I in Id as ${user.ssoid} will result in errors.

      <script>
      window.Appcues.identify(
        ${user.ssoId},  // unique, required
        {
      
        }
      );
      </script>
      
      <script>