Stacking Piwik codes with different IDs in one web page

We are currently trying to determine if we can stack 2 different Piwik tracking codes with 2 different Piwik IDs in one web page. We believe that this is possible and could provide us with what we need to track different sub-sections/directories of a website.