Proxy Hide URL - new code doesn't working

Hello,
The old version code works:


<!-- Piwik --> 
<script type="text/javascript">
var pkBaseURL = ("http://trackedsite.com/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.php' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 5);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
<!-- End Piwik Tracking Code -->

I change the old code to the new code for Piwik 1.12 (matomo/misc/proxy-hide-piwik-url at master · matomo-org/matomo · GitHub). Unfortunately, this code doesn’t working:


<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
       var u=(("https:" == document.location.protocol) ? "https" : "http") + "://trackedsite.com/";
       _paq.push(["setTrackerUrl", u+"piwik.php"]);
       _paq.push(["setSiteId", "trackedsite-id"]);
       var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
       g.defer=true; g.async=true; g.src=u+"piwik.php"; s.parentNode.insertBefore(g,s);
   })();
   </script>
   <!-- End Piwik Code -->

Can anyone help me to solve this problem?

It should work the same. Do you get any Javascript error ? Otherwise you may try to debug the request to piwik.php as explained in: http://piwik.org/docs/tracking-api/reference/#toc-debugging-the-tracking-api-requests