0

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.

Eatsam ul haq
  • 317
  • 1
  • 12
  • 1
    Such a tracking can only work when all the stores are using the same tracking tool. If you're going to create your own tool, very likely it's not adapted by other stores, hence the question falls to ask recommendations for a tool, library etc. – Teemu Jan 13 '22 at 08:37
  • @Teemu isn't there a javascript code that will help me in tracking. I know there are many application that use such type of tracking techniques – Eatsam ul haq Jan 13 '22 at 08:41
  • There's no easy way - I suppose if you create it as a browser extension then you might be able to get away with it by manipulating the page javascript; but the downside is that if they tweak the page structure, you'll have to rewrite the javascript to match... Realistically, without knowing the way the site you want to track is written, I don't know whether it's even feasible without server callbacks of some kind. – Andrew Corrigan Jan 13 '22 at 08:45

0 Answers0