How to use
In order to get and set data, the commands need to be implemented properly, following the instructions detailed in this section.
How to send commands?
You can send commands to Rosetta.ai by the following method:
name - 'config'
| 'query'
| 'event'
| 'purchase'
params - based on the command name
cb - callback function, some commands support this
config
config
The config
command is used to set up your app id and user id. This is not really needed for Plugin only users.
config
command is used to set up your app id and user id. This is not really needed for Plugin only users.Sending config
command by the following method:
● If you are using SDK file
If you want to use the SDK file, then first thing to do is to call the config command for setting up the app ID. You need to do this before any other command in your code!
The app ID will be provided at the very beginning of Rosetta.ai service. You can set the value by config command.
● If you are using plugin file
You are using the plugin file, then you don't really need to set the app id because this is automatically done for you by in that file. However, if you still want to use custom data (like for example your Line app id), then you can use this command for setting this type of information.
Example
Parameters
The following are the accepted parameters. You can send them in a JSON as seen in the example above
query
query
The query
command is used to get the data of recommended products.
query
command is used to get the data of recommended products.Sending query
command by the following method:
Via Sending query
command with the parameters to fetch the API and get the data from the callback function.
Example
Parameters
The following are the accepted parameters. You can send them in a JSON as seen in the example above
Example of response
The response is an array of object
event
event
The event
command is used to record your users' actions.
event
command is used to record your users' actions.By doing so, you increase the reliability and accuracy of predictions over the time.
Event Types
Remember that you only need to send attribution data is in click events. You don't need to send attribution data in other types of events. Rosetta will automatically record the attribution for the rest of the actions (select, unselect, etc.).
Examples
render
view
click
Please send the event command with attribution data(provider, context, source).
select
Do not need to send the event command with attribution data.
unselect
Do not need to send the event command with attribution data.
You must have these events defined throughout your site. By not doing so, the accuracy of predictions will suffer greatly.
Parameters
The following are the accepted parameters. You can send them in a JSON as seen in the example above
purchase
purchase
The purchase
command is used to record the data of the orders that your customers make.
purchase
command is used to record the data of the orders that your customers make.Sending purchase
command by the following method:
Example
Parameters
The following are the accepted parameters. You can send them in a JSON as seen in the example above
If you have any installation questions, feel free to contact us: Rosetta.ai | Medium | Facebook
Last updated