Skip to content

bug: track_links cannot select via a data-attribute DOM query #62

New issue

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

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

Already on GitHub? # to your account

Open
cardoni opened this issue Dec 10, 2015 · 1 comment
Open

bug: track_links cannot select via a data-attribute DOM query #62

cardoni opened this issue Dec 10, 2015 · 1 comment

Comments

@cardoni
Copy link

cardoni commented Dec 10, 2015

Given a link of the form:

<a href="//somelink.com" data-download-link title="title here" target="_blank">
 some text here
</a>

I cannot successfully get mixpanel.track_links to work, via this:

mixpanel.track_links( "[data-download-link]", "Download Link Clicked" );

"[data-download-link]" is a valid DOM query string, however.

@cardoni cardoni changed the title track_links cannot select via a data-attribute DOM query bug: track_links cannot select via a data-attribute DOM query Dec 10, 2015
@villaaston
Copy link

villaaston commented Aug 8, 2017

Had a similar problem recently. Looks like this is because the regex for making the attribute match uses (\w+) to select the attribute name. If it used ([\w\-]+) then attributes with dashes would work.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants