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:

The possible values of the parameters

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

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 the class_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 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&amp;start-lon=37.588533418821726&amp;end-lat=55.76776211471192&amp;end-lon=37.60714921124336&amp;tariffClass=econom&amp;ref=yoursiteru&amp;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 the target="_blank" parameter, since some browsers may block the link from opening in a new window.

  • For iOS, links are supported in Universal Links format.

The link for a trip departing from Ulitsa L'va Tolstogo, 16, Moscow, to arrive at Ulitsa Malaya Dmitrovka, 6, Moscow for Yandex Go looks like this:

https://3.redirect.appmetrica.yandex.com/route?start-lat=55.73400123907955&amp;start-lon=37.588533418821726&amp;end-lat=55.76776211471192&amp;end-lon=37.60714921124336&amp;tariffClass=econom&amp;ref=mywebsiteru&amp;appmetrica_tracking_id=1178268795219780156
In this article: