I have following tracking code.
<!-- Tracking Code -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://example.com/" : "http://example.com/");
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", 29);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://example.com/piwik.php?idsite=29" style="border:0" alt="" /></p></noscript>
<!-- Tracking Code -->
I want to hide following code, so I think I can put this code in some js file, and load it using following code.
But I don’t know how can I do it. Help required here.
Secondly, I need to change site id (in above example, is 29), which will be different for different site.
How can I pass site-id to custom file that I will make, and execute above code.