The answer is simple enough to add your script to theme files🙊
Google Adsense
-
Create an ad partial like
ad-banner.hbs
template and copy/paste your ad script to the file. -
Edit the relevant files (e.g.
index.hbs
,post.hbs
, etc...) to insert the ad partials.
Google Analytics
To add Google Analytics, not only you can insert the script to your theme files but also use the built-in code injection in Ghost.
To use the code injection:
-
Check if your theme supports the code injection (most themes do).
-
Go to Admin page of your blog and go to Settings | Code Injection.
-
Insert your script in the header section of code injection.
To insert directly into the themes, follow the same steps as the Adsense, but since this is a tracking script, you shall be able to insert your script to the default.hbs
without creating a separate partial.