1 link to track goals for all of my sites?

Hello

Ive finished adding my sites to piwik and would like to track goals. Is there any way to track goals for all of my sites using one piwik script/code? I use swreg.org and cannot add individual codes for my products. Thank you in advance.

Would something like this work for you?


[IF="TEMPLATEID"=="4"]

<script type="text/javascript" src="http://mysite/piwik.js"></script>
<script language="JavaScript" type="text/javascript">
var tracker = Piwik.getTracker('http://mysite/piwik.php', 1);
tracker.enableLinkTracking();
tracker.trackPageView();

// map product codes to goal IDs
var productsAndGoals = [
    'productcode1' : 1,
    'productcode2' : 2
];
[FOREACH="BASKET"]
    tracker.trackGoal(productsAndGoals['###BRPRODCODE###'], '###BRTOTAL###');
[ENDFOREACH="BASKET"]
</script>
[ENDIF="TEMPLATEID"]

where should I put it? in global template? …but I dont have any global template , darn

I have over 200 sites in piwik, would this code track goals of all 200 sites?

Edit: disregard the first line :slight_smile: