I am trying to track user engagement on a cross domain. I have seen similar questions on stack overflow already like Tracking purchase of particular product on different sites and jQuery Cross Domain Request to get JSON Response without Callback But the problem with my case is that I do not want server call back and Google analytics to be used with my application
About my application, basically we have made a spring boot application
and we provide our application as a resource to another e-commerce store. Now, what our application will do, it will replace the search bar of that e-commerce store with our application's search bar. when the user searches a product from that search bar then our application
will bring the result (products) from that e-commerce store
.
Now what I want to do, I want to track my user such that after searching, if the user clicks on any product from the search result
then he will be redirected to the checkout page
of the same e-commerce store
. I want to track that if that user bought that product or just got there and returned without purchasing the product.
If I try to do it through javascript
, then I get cross-origin error (CORS-policy)
which is kind of obvious as we can not access any other application from our site.
I also tried YQL
Yahoo Query Language
as suggested by jQuery Cross Domain Request to get JSON Response without Callback but still got CORS origin error
.
I have looked a way for server callback where, every time when user clicks a product from the search result then an reference id will send with him. After the customer purchases a product then the server will give us a callback and will again return a reference id back to us.
But this type of approach was rejected by my company saying it will be very expensive for us.
I was looking for a simple solution that will track user engagement on Cross Domain with a simple and free tool except for Google analytics OR by writing a javscript on my end without involving the other server.
I have researched a lot but could not find a good answer. Please help me. Thanks in advance.