Countly/countly-sdk-web

track_links & track_clicks didn't track dynamic added dom elements

jianglinchun opened this issue · 7 comments

If we had a ajax request and append some dom elements to the document.
The track_links & track_clicks will not be triggered on those newly added elements.

Currently you can call track_links or track_clicks method and provide parent element of changed content for example to add those new elements to registry

But I will try to think on better solution

Are you sure track_clicks is not working, from the code it should work, cause it listens to bubbled evens on the document level

tested under chrome many times. Pls check.

This issue should be fixed on development branch by c324f3d

Note if you want to try development branch, then it currently does not parse user agent and does not send all metrics to server, metrics are post filled by web plugin on server side (which require some modifications on server)

Will close issue after release, when development branch is merged

I'd review the fix. And I found that closest was use to fix this issues. Please make sure compatible problems.

http://stackoverflow.com/questions/18663941/finding-closest-element-without-jquery

Btw: countly may focus on App statics tracking and analytic. But web/wap/h5 still a important entrance.

I had test the latest branch and it works.

Yes, there is a polyfil for when it is not available:
684e415

So it should be compatible with older systems too