Set Registered User IDs from Email

If you have existing users in your user database or CRM system, you can set SkyGlue Ids to their existing user IDs.

Using email to set user IDs is a common way to achieve the above. You can send emails (e.g. promotion, new release, etc.) to your existing customers that contain a unique  link for each one of them. The link carries user’s registered user Id as a URL query parameter. For example:

Once the user clicks on the link and goes to your website, you can set his/or SkyGlue registered user Id to the existing user Id using JavaScript.

The following is the sample JavaScript code:

var userId=getParameterByName('uid');
var _sg_registeredUserId;
   _sg_registeredUserId = userId;

This is the sample function to get the query parameter value (many similar functions available online)

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(;
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));

Please contact us if you have any questions with the above implementation.