You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- A user ID must ALWAYS be a string or a number. Anything else will trigger an error and the call will not be sent to Outbound. User IDs are always stored as strings. Keep this in mind if you have different types. A user with ID of 1 (the number) will be considered the same as user with ID of "1" (the string).
65
-
- A user ID should be static. It should be the same value you use to identify the user in your own system.
66
-
- Some times you don't have a user id yet for a user but you still want to identify them and trigger events for them. You can do this by generating a new ID (call this the anonymous ID) and identify the user as you normally would. Then, once the user becomes a real, identifiable user and you have a real ID for them, make another identify call, this time pass in the anonymous ID as the previous ID.
67
-
68
-
user_info = {
69
-
:previous_id => anonymous_id,
70
-
}
71
-
Outbound.identify("USER ID", user_info)
72
-
73
-
### Groups
74
-
You can create a set of attributes and have them be inherited by a group of users. This can all be done with the `identify` call.
75
-
76
-
user_info = {
77
-
:group_id => 'group identifier',
78
-
:group_attributes => {
79
-
... attributes shared by the group ...
80
-
}
81
-
}
82
-
Outbound.identify("USER ID", user_info)
83
-
84
-
- Group IDs are treated just like user IDs. They should only be strings or numbers.
85
-
- Users in a group will inherit group attributes but user attributes take precedences. So if there is an attribute `state` set on the group and it is set to "California" and there is also a `state` attribute set on the user but set to "New York", the value for that user is "New York". If the user didn't have that attribute, the value of `state` for that user would be the group value which is "California".
86
-
- You only need to pass in the group attributes when they are initially set or when they are updated but you do need to set the group id for each user you want to be in the group.
87
-
88
-
### Event Name
89
-
- An event name in a track can only be a string. Any other type of value will trigger an error and the call will not be sent to Outbound.
90
-
- Event names can be anything you want them to be (as long as they are strings) and contain any character you want.
91
-
92
-
### Device Tokens
93
-
- If you send a device token through an `identify` call, that is equivalent to sending a `register` call. Regardless of the state of that token it will become active again and we will attempt to send notifications to it. It is recommended that if you use the `register` and `disable` calls that you DO NOT send any tokens in `identify` calls. This way you can more easily control the state of your tokens.
94
-
95
-
### Results
96
-
- Both the `identify` and `track` methods return a `Outbound::Result` instance. It has `error` and `received_call` attributes that are accesible. `received_call` is a boolean that indicates if the http request was even made. `error` will be either `nil` or a string error message. There is also a `success?` method that returns true if the call went through to Outbound and did not have any errors. There are also `?` method available for each different error type.
3
+
Learn more about the Outbound Ruby Library by going
4
+
to [docs.outbound.io](http://docs.outbound.io/v2/docs/ruby).
0 commit comments