A
A
Alexey2016-04-05 08:51:11
Electronic commerce
Alexey, 2016-04-05 08:51:11

At what point should data be sent to Yandex e-commerce?

Good afternoon!
There is a self-written online store. There are 2 ways to pay for goods - in cash upon receipt or online payment through Yandex.Checkout. Right now, ordering works like this:

  1. Cash payment - we send a letter about a new order to the manager, send the data to Yandex e-commerce (hereinafter referred to as EC I) and clear the session for the visitor;
  2. Payment via Yandex.Checkout - send data to EC Ya, redirect to the payment page (on the Yandex.Checkout side), at the moment when the store receives a message about a successful payment, send a letter about a new order to the manager, if after payment the visitor returns to the site, clear the session

The scheme works, but I don’t like that if the visitor could not (or changed his mind) for some reason pay for the order through Yandex.Checkout, he returns to the site, chooses to pay in cash and the data in the EC I are sent again.
Of course, it would be more correct to send data to EC I at the moment when the visitor is shown a confirmation page that his order has been sent, but in the case when they pay through Yandex.Checkout after a successful payment, there will be no obligatory redirect to the store's website, i.e. close the browser window and no data will be sent.
Data is sent to CI I only when the Yandex.Metrica counter is fully loaded, i.e. at the moment when Yandex.Checkout "informs" the store that the order has been paid, it will not be possible to send the data.
The question is - is it possible to apply some other scheme and how is it already implemented in other online stores?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Likhachev, 2016-04-14
@AmateR

So send the target at the moment when Yandex cash register reports payment. You can see the server implementation of this repository https://github.com/hcodes/server_yametrika , or use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question