This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Session properties | |
| // client-side JS | |
| ax.session({ | |
| property1: "value", | |
| property2: "value" | |
| }); | |
| // server-side HTTP request | |
| curl https://api.aidax.com.br/session?key=<key>&uid=<user id>&origin=<optional session origin>&p=<session properties in JSON format> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Check if user belongs to profile that likes red fruits | |
| // client JS | |
| ax.query({ | |
| type: "profile", // user, session, profile, event or metric | |
| value: "red_fruits", //required for profile and event | |
| callback: function(data) { | |
| // returns true or false | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Identification of João in session WITHOUT import previously captured properties | |
| // client-side JS | |
| ax.user({ id: "joao@email.com", migrate: false }); | |
| // server-side HTTP request | |
| curl https://api.aidax.com.br/user?key=<key>&uid="joao@email.com" | |
| // Identification of João in the session WITH import previously captured properties | |
| // client-side JS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Identification of João in the session | |
| // client-side JS | |
| ax.user({ id: "joao@email.com" }); | |
| // server-side HTTP request | |
| curl https://api.aidax.com.br/user?key=<key>&uid="joao@email.com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adding John Properties at run time without id | |
| // client-side JS | |
| ax.user({ | |
| properties: { | |
| age: "25", | |
| job: "Data Analyst", | |
| $tags: ["beer"] | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Identify User | |
| // client-side JS | |
| ax.user({ | |
| id: "USER ID", //If the id is an email AIDAX will contextalize the id | |
| properties: { | |
| property1: "value", | |
| property2: "value" | |
| }, | |
| migrate: true //optional parameter to migrate old user data in this session to the new user. Default is true | |
| }); |
NewerOlder