Generating links to an order
To redirect a user to a website or mobile app, you need to create a link that contains the trip parameters. After clicking on this link, the user will see the route of the trip and will be able to order a taxi.
By default the link leads to the app if the user has it installed. If the application is not installed, the further behavior of the link is determined by a set of parameters app_code
and appmetrica_tracking_id
:
Service |
Destination |
|
|
Yandex Go |
Yandex Go app page in the app store |
3 |
1178268795219780156 |
Yandex Go |
Yandex Go site |
3 |
25395763362139037 |
You can use links to collect order statistics. To receive statistics on your orders, write to taxi-api@yandex-team.ru.
Link format
https://<app_code>.redirect.appmetrica.yandex.com/route?
start-lat=<latitude>
&start-lon=<longitude>
&end-lat=<latitude>
&end-lon=<longitude>
&tariffClass=<tariff>
&ref=<source>
&appmetrica_tracking_id=<redirect_id>
&lang=<language>
Parameters:
- app_code
-
ID of the service whose application you want to open. Required parameter. Value for the Yandex Go app:
3
.
If the application is not installed on the user's device, the redirect logic is determined by the appmetrica_tracking_id parameter. - start-lat
-
Departure point latitude. Optional parameter. Used with the
start-lon
parameter. - start-lon
-
Departure point longitude. Optional parameter. Used with the
start-lat
parameter. - end-lat
-
Destination latitude. Optional parameter. Used with the
end-lon
parameter. - end-lon
-
Destination longitude. Optional parameter. Used with the
end-lat
parameter. - tariffClass
-
Text fare ID. Coincides with
class
values in requests to API and with the API response in theclass_name
field. Optional parameter. The parameter is only available when the departure or destination points for the journey are indicated. - ref
-
Source ID. This parameter is used for passing on your affiliate program ID, or the name of your resource if you don't have an ID. The value in this parameter must contain Latin characters only. For example, mywebsite.ru can have the ID,
mywebsiteru
. - appmetrica_tracking_id
-
ID that determines the redirect logic. Required parameter.
If the user already has the Yandex Go app, then the link will work as a deeplink and send the user to the app.The possible values depend on the service (which is specified in the app_code parameter) and redirect destination:
Service
Destination
app_code
parameter valueappmetrica_tracking_id
parameter valueYandex Go
Yandex Go app page in the app store
3
1178268795219780156
Yandex Go
Yandex Go site
3
25395763362139037
For example, if you want to redirect a user who logs in from a mobile device to the Yandex Go page in the app store, you need to specify the following parameters:
https://3.redirect.appmetrica.yandex.com/route?start-lat=55.73400123907955&start-lon=37.588533418821726&end-lat=55.76776211471192&end-lon=37.60714921124336&tariffClass=econom&ref=yoursiteru&appmetrica_tracking_id=1178268795219780156
Note
-
The departure and destination point parameters are optional. To receive the coordinates for addresses given by users, use the Geocoder API.
-
We do not recommend setting links in
iframe
or using thetarget="_blank"
parameter, since some browsers may block the link from opening in a new window. -
For iOS, links are supported in Universal Links format.
Link example
The link for a trip departing from
Ulitsa L'va Tolstogo, 16, Moscow
, to arrive atUlitsa Malaya Dmitrovka, 6, Moscow
for Yandex Go looks like this:https://3.redirect.appmetrica.yandex.com/route?start-lat=55.73400123907955&start-lon=37.588533418821726&end-lat=55.76776211471192&end-lon=37.60714921124336&tariffClass=econom&ref=mywebsiteru&appmetrica_tracking_id=1178268795219780156
lang
for the response language. Optional parameter. Possible values:
ru
for Russian. Default value.en
for English.uk
for Ukrainian.kk
for Kazakh.az
for Azerbaijani.ka
for Georgian.hy
for Armenian.ky
for Kyrgyz.lv
for Latvian.ro
for Romanian.uz
for Uzbek.et
for Estonian.fr
for French.
ID that determines the redirect logic. Required parameter.
If the user already has the Yandex Go app, then the link will work as a deeplink and send the user to the app.
The possible values depend on the service (which is specified in the [app_code](*#section_qfs_zmb_dcb) parameter) and redirect destination:
Service | Destination | app_code parameter value* |
appmetrica_tracking_id parameter value |
---|---|---|---|
Yandex Go | Yandex Go app page in the app store | 3 | 1178268795219780156 |
Yandex Go | Yandex Go site | 3 | 25395763362139037 |
For example, if you want to redirect a user who logs in from a mobile device to the Yandex Go page in the app store, you need to specify the following parameters:
https://3.redirect.appmetrica.yandex.com/route?start-lat=55.73400123907955&start-lon=37.588533418821726&end-lat=55.76776211471192&end-lon=37.60714921124336&tariffClass=econom&ref=yoursiteru&appmetrica_tracking_id=1178268795219780156
Source ID. This parameter is used for passing on your affiliate program ID, or the name of your resource if you don't have an ID. The value in this parameter must contain Latin characters only. For example, mywebsite.ru can have the ID, mywebsiteru
.
Text fare ID. Coincides with class
values in requests to API and with the API response in the class_name
field. Optional parameter. The parameter is only available when the departure or destination points for the journey are indicated.
Destination longitude. Optional parameter. Used with the end-lat
parameter.
Destination latitude. Optional parameter. Used with the end-lon
parameter.
Departure point longitude. Optional parameter. Used with the start-lat
parameter.
Departure point latitude. Optional parameter. Used with the start-lon
parameter.
ID of the service whose application you want to open. Required parameter. Value for the Yandex Go app: 3.
If the application is not installed on the user's device, the redirect logic is determined by the appmetrica_tracking_id parameter.