{"id":4415868,"date":"2013-12-15T19:14:52","date_gmt":"2013-12-15T19:14:52","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/bug-51\/"},"modified":"2016-08-21T13:32:51","modified_gmt":"2016-08-21T13:32:51","slug":"bug-51","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/bug-51\/","title":{"rendered":"Bug?"},"content":{"rendered":"<p>Hello, i have changed your script.js. I had wrong events, it always trhown the last working Special Event, and didn\u00b4t look for the other ones.<\/p>\n<p>If we declare a function like this one:<\/p>\n<pre><code>function listener($special, events){\n    $($special.selector).on(events.join(&quot; &quot;), function () {\n        if($special.name){\n            $(this).attr(&quot;te_oname&quot;, $special.name);\n        }\n        var eventLabel = ethoseoteCalculateLabel($(this), [&quot;te_oname&quot;, &quot;te_name&quot;, &quot;name&quot;, &quot;title&quot;, &quot;id&quot;, &quot;href&quot;]);\n        var eventInfo = [&#039;_trackEvent&#039;, $special.category, $special.action, eventLabel];\n        ethoseotePushEvent(eventInfo);\n    });\n}<\/code><\/pre>\n<p><strong>and call it from the loop:<\/strong><br \/>\n\t<code><\/code>for (i = window.trackeverything.special.length &#8211; 1; i &gt;= 0; i&#8211;) {<br \/>\n\t\tvar $special = window.trackeverything.special[i];<br \/>\n\t\t$($special.selector).off(&#8220;.jqtedefault&#8221;);<br \/>\n\t\tif(window.trackeverything.settings.debug){<br \/>\n\t\t\t$($special.selector).addClass(&#8220;track-everything track-everything-special&#8221;).removeClass(&#8220;track-everything-default&#8221;);<br \/>\n\t\t}<br \/>\n\t\tvar events = [];<br \/>\n\t\tfor (var j = $special.events.length &#8211; 1; j &gt;= 0; j&#8211;) {<br \/>\n\t\t\tevents.push($special.events[j] + &#8220;.jqte.jqtespecial&#8221;);<br \/>\n\t\t}<br \/>\n        <strong>listener($special, events);<\/strong><br \/>\n\t}<code><\/code><br \/>\nit works great for me. Could you test it?<\/p>\n<p>https:\/\/wordpress.org\/plugins\/track-everything\/<\/p>\n","protected":false},"template":"","class_list":["post-4415868","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4415868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4415868\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4415868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}