How to track multiple instances in async mode


(Matty Bee) #1

Hi,

I currently track each page twice, which works great.

How can I convert the below code to use async mode. I only know async mode for the standard tracking code.

<script type="text/javascript">
         var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.example.com/tools/piwik/" : "http://www.example.com/tools/piwik/");
         document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
     </script>
 <script type="text/javascript">
         try {
             var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2);
             piwikTracker.trackPageView();
            piwikTracker.enableLinkTracking();
         }catch( err ) {}

         try {
             var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 17);
             piwikTracker.trackPageView();
             piwikTracker.enableLinkTracking();
         }catch( err ) {}
         ;
     </script>

Thanks.