Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native tracker manager click tracker not firing #103

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

wqi1972
Copy link
Contributor

@wqi1972 wqi1972 commented Apr 30, 2020

Refactor code inside attachClickListeners, so that it read adId from the <a> tag element instead of read it from event.target.
Code read from event.target has trouble when there is inner tag inside <a> tag, for example:
<a href="%%CLICK_URL_UNESC%%%%PATTERN:hb_native_linkurl%%" target="_blank" class="pb-click" pbAdId="%%PATTERN:hb_adid%%"><p>%%PATTERN:hb_native_title%%<p></a>
when click event fires, the <p> tag is the event.target, not <a> tag, in that case, original code inside function readAdIdFromEvent won't work.

Adjusted test case for it as well.

@bretg
Copy link
Contributor

bretg commented May 26, 2020

@wqi1972 - is this PR needed even if we implement the improvements to native as noted in prebid/Prebid.js#5149?

@wqi1972
Copy link
Contributor Author

wqi1972 commented May 26, 2020

@bretg we won't need this PR after prebid/Prebid.js#5149. Inside prebid/Prebid.js#5149 it will fundamentally solve this problem, since new implement will pass adId as parameter, there will be no need to read adId from html element anymore.

If we have some Universal creative release before prebid/Prebid.js#5149 get implemented, I suggest we merge this PR into it, since this bug already impacts some publishers (#88). If we don't, then we can close this PR and wait for prebid/Prebid.js#5149 solve it fundamentally.

Copy link
Contributor

@robertrmartinez robertrmartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@jsnellbaker jsnellbaker merged commit 96816e0 into prebid:master Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants