Tracking events - Tag Manager vs JS code

Hi all,

I’ve a some questions about the guide about events tracking.

  1. Is there something I couldn’t do using the Tag Manager compared to “JS manual tracking code”? i.e. let’s say I have this JS code:
function foo()  {
   // function code here
}

and I need to fire a tracking event when the code just enters the function. Using the JS, I could simply add the code:

function foo()  {
   _paq.push(['trackEvent', 'X', 'Y', 'Z']);
   // function code here
}

Could I do something similar using Tag Manager?

  1. Are Tag Manager and “JS manual tracking code” mutually exclusive?

  2. Is it possible to use the Tag Manager to set a javascript variabile that will be used in the JS code? I.e. My code has a variabile like var carouselChangeTime = 10000; I would like to set this variable using Tag Manager, to not request support to the development team and release team if I have to change its value.

Thanks you guys for tour answers!