Tracking the purchase of a specific product on different sites

I have a website where other site owners can list their products. To list a product, they need to manually create a product by providing title , description , image and link for the products.

When a user visits my site, he will be able to view these products, and when you click on any product he will be redirected to the owner’s website, and a purchase will be made on his website.

Now I need to create functionality with which I can track the complete transaction of the sale of this particular product, whether this particular product was sold or not.

  • Whenever any site owner comes to my site to list his product, he must first register on my site.
  • After registering, I can provide him with a piece of the script that he needs to put on the title of his site.
  • In addition, I can’t change his site. And I just need to track a specific product transaction.

I searched and found that Trivago and Skyscanner use something like this.

I tried to create several scripts in JS, but could not track the necessary things, because once the user did not buy my product, and I did not know about it. On some sites, the thank you page does not have enough sales information to capture.

If possible, just by adding a few more things to the Marchent website, please let me know.

+5
source share
3 answers

To make sure your Postback works on all platforms and providers, you must provide several ways for your sellers to implement their websites.

  • JS script (you already did it)
  • The implementation of the server to the server (S2S callback) - where you send the order identifier in the headers or get the parameters, and the seller must provide it back.

Example : you send your traffic as below: http://merchant_url.com/?tracking_id = 123123123

Merchant returns back when your tracking URL is purchased:

http: // your_tracking_url /? merchant_id = 1 & tracking_id = 123123123

This way you can identify your traffic

  • 1px iframes that load on the thank you page and pass click_id click parameters.

Example : your merchant should post something like below on the thank you page:

  <iframe src="http://your_tracking_url_iframe/tracking_id=123123123" style="height:1px;width:1px"/> 
  • Finally, in such cases, even 1px image elements are usually used.

An example :

  <img src="http://your_tracking_url_img/?tracking_id=123123123" style="height:1px;width:1px"/> 

Thus, even if the seller uses simple html / js on the thank you page, he can always load your iframe with the specified parameters that will help you track the sale.

Hope this helps.

+3
source

You can use cookies for easy implementation.

Since the end customer must appear from your site, it must have your cookie with userId and productId before it goes to another website.

On the thank you page another site, there should be a call to your server (usually this is a 1px image). On the server side, you will have the same cookie and website as referer .

Then you can tell on the website how many customers catch after clicking on the product on your service. (Be sure to consider that it is sold only once per user!)

If the website wants to be cross-checked, they can provide you with product identifiers when they call, so you only count if the identifiers match.

0
source

This is difficult, not because of technology, but because of the variety of decisions in the field of commerce and the open nature of human choice.

It looks like you created two vital components for this job: the ability to identify registered merchants and the ability to host a script on your web page.

I need a third component, I think; either a consistent interface for this script (as soon as a commercial transaction is completed or fails, pass the object with statuses back to your script through a specific triggered event) or fully familiarize yourself with the events for the seller’s website that you can code.

Encoding the unknown will take a lot of time and effort, since you will need to learn each transaction solution for outlets and how to capture transaction data. It will be ... a long way, and I do not think it will be very successful.

If the seller’s site is ready, it can trigger an event that your script will listen to and transmit transaction data through, which will allow your script to go through AJAX to the wait tracking page to record the results. This is easiest in terms of reaching an agreement and for working from your specified starting point. jQuery is a great library to hook it all up, and there are other options.

Part of the tracking will go through the token, which should be transferred through the transaction and transferred back generated by your site to a click on the seller’s website and transferred from there. After you return the token, you can compare it with the database of transaction tokens to find out which event has which result and fill in the corresponding fields from the received data.

0
source

Source: https://habr.com/ru/post/1275598/


All Articles