Help with tracking a subdomain

I’ve thoroughly read the documentation and while I understand the general idea behind subdomain tracking, I’m not 100% if I got everthing right. So I just need a little bit of help…

Say I have the domain (that I have been tracking for a while) and now I want to track a ministe on

So I added the as a new site - that now has the ID 2.

the default code is:

try {
var piwikTracker = Piwik.getTracker(pkBaseURL + “piwik.php”, 1);
} catch( err ) {}

So what I understand I need to be doing is adding the follwing code on the footer of the subdomain only:

try {
var piwikTracker2 = Piwik.getTracker(pkBaseURL + “piwik.php”, 2);
} catch( err ) {}

Did I get it right?

Looks good