JavaScript-Tracking-Code on each page?

Piwik is installed on the server.

Did I get it right? You have to add this code shown below to each single (php, htm, html) page of your website? So I would do a search and replace, I assume. What program could I use to do it? Or is there another way to get the code added to the pages?

Is this correct (including the page tracking code), can I add the code like it is?):

< src=“” style=“border:0” alt="" />

Most of the code I have added here seems to be missing. How can I add a complete piece of code here?

One does not have to copy an image to the server?

What further options are recommended to use?

I have read this - Log Analytics - Analytics Platform - Piwik - but I do not understand how I could use / get the Log Analytics, what do I have to import / to do?