My Options :
include the analytics code in page templates or CTs.
create a component contains the analytic code and render it in Comonent presentation of the page.
which could be better or please suggest any other way out.
The first approach is normally preferable, since it allows you to include information about a component or page in your call to Google Analytics. And you may not even have to write it yourself, since there is a free extension called the Web Analytics Enabler, which is available here. I recommend that you check that out first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With