You can add google analytics code in your default theme header or footer file also u can use simple analytics wordpress plugin to add code.
IN wordpress it is a inbuild option you just login to your wordpress admin, select the general setting then you can see the option and there you can put the code GAXXXXXXXX