SkyGlue Visitor Tracking API

SkyGlue lets you explicitly push a registered userID to Google Analytics in order to identify the behavior of a specific visitor.

Step 1: Set up visitor tracking to use your backend user ID

SkyGlue automatically tracks visitors using two IDs:

(1) visitor ID (e.g.1491284089.1575990169). This ID is generated based on the Google Analytics client Id using utma cookie value (in classic GA) or GA client Id (in unversal analytics). If you set up cross-domain tracking in your Google Analytics, this ID will remain the same across domains. This ID is based on browser cookie. It will be different for different browsers or different machines.

(2) registered user ID (e.g. B1E2DB3). If you set up registered user tracking in your SkyGlue portal, this ID is generated using the login/signup form value visitor submitted. It is a hash value of the user ID of the field value you specified in the SkyGlue portal. The ID will be the same for the same registered user even if he/she uses different browsers or machines. This ID can be found under event label in Google Analytics.

You can set the value of registered user Id with your own back-end UserID using the following approach: (Please note, Google Analytics does not allow any PII data to be sent to its server.)

To set a registered ID, define a global Javascript variable “_sg_registeredUserId” anywhere in your web page. It should be a string without space.

The ID is set using server side language, such as php, asp, python, etc. Following is an example of PHP.

<script type=”text/javascript”>

//Make sure the visitor is logged in before call the following line to define the global javascript variable. You can set var _sg_registeredUserId to null if the user is not logged in.

var _sg_registeredUserId=”<?=$_myRegisteredUserIDValue?>”;


SkyGlue can optionally set the registered user Id as “user Id” in universal analytics and/or a custom dimension. If you want to set them in your account, please contact support by email.

The difference of setting SkyGlue registered user Id vs. setting GA user ID directly using GA JavaScript API is that you only need to set the registered user ID once on one page using SkyGlue API and SkyGlue can store it in a cookie and use it in all following pages a user visits. You don’t need to set the ID value in all pages. While GA API doesn’t store the registered user ID in a cookie. You need to set the user ID value in all pages.

Step 2: View visitor activities using your back-end user ID

You can enter the registered user ID into the Registered ID search box on your SkyGlue user report to retrieve the visitor’s digital path.