Documentation Center

Tracking Subscriber Aliases

Learn how to track subscriber aliases.

Subscriber Aliases enable you to associate another username and/or email with a particular subscriber providing a simplified way to send server-side requests to track attributes, events or send notifications against a specific subscriber.

Getting Started Tracking Aliases

The first step to tracking user aliases is by adding the alias tag to your website. Place the following code before the end of your </body> tag.

<script> 
_at.track("alias", {"user": "USERNAME", "email":"EMAIL_ADDRESS_OR_EMAIL_HASH"})
</script>

 

You may use either (or both) the user and email fields. They are not both required. We encourage you to hash your emails, but even if you do not our systems will automatically do so.

Once you've added that to your site, you can begin checking the logs in your dashboard to ensure they are coming through. Again, please note that if you passed emails they are hashed in our database so you will see only the hashed version in the logs.

 

Sending Calls With Aliases

After you've begun tracking aliases you can send calls to our API as shown below, passing either the "user" field or the "email" field as set previously.

 

Tracking an Event or Attribute

curl -XPOST 
-H 'X-Authorization-Api-Key: API_KEY'
-H "Content-type: application/json"
-d '{
"idSite": 12318,
"user" : "USERNAME",
"event":{
"category":"video",
"action": "watched"
},
"attributes":{
"videos_watched":5
}
}'
'https://api.aimtell.com/prod/subscriber/'

 

Sending a Push Notification (using user alias)

curl -XPOST 
-H 'X-Authorization-Api-Key: API_KEY'
-H "Content-type: application/json"
-d '{
"idSite": 12318,
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"alias": "user==USERNAME"
}'
'https://api.aimtell.com/prod/subscriber/'

 

Sending a Push Notification (using email address alias)

curl -XPOST 
-H 'X-Authorization-Api-Key: API_KEY'
-H "Content-type: application/json"
-d '{
"idSite": 12318,
"title": "An Awesome Push",
"body": "Looks pretty great.",
"link" : "https://aimtell.com",
"alias": "email==EMAIL_ADDRESS_OR_EMAIL_HASH"
}'
'https://api.aimtell.com/prod/subscriber/'

 

Check out our API docs for more examples.