Documentation menuContent management systems: Ghost

Content management systems

Add Loogika to Ghost

Ghost can insert HTML into the head of each page through Code injection, a setting that ships with Ghost. Paste the Loogika tag into the Site header box there and save. You do not need to edit your theme.

Last updated .

What do you need before you start?

Copy your script tag from Site Settings in Loogika, under the Tracking Script tab. It looks like this, with your own site ID in place of YOUR_SITE_ID:

<script src="https://app.loogika.com/api/script.js?siteId=YOUR_SITE_ID" defer></script>

How do you add Loogika to Ghost with Code injection?

Code injection takes three steps in Ghost Admin.

  1. In Ghost Admin, find the Settings gear at the bottom left and click it.
  2. Find the Advanced group and open Code injection.
  3. Paste the tag into Site header and click Save.

Can you add the tag to a Ghost theme?

Yes, if you maintain your own theme. Open default.hbs and paste the tag just before the closing </head> tag.

We recommend Code injection over a theme edit, also on Ghost(Pro) with a custom theme. Ghost applies Code injection on top of the theme, so the theme files stay untouched.

How do you check that Loogika is installed?

Load your publication in a fresh browser tab and visit a few posts. The pageviews appear in the Loogika dashboard within a few seconds.

If nothing arrives, open the page source and look for script.js?siteId=. When the tag is there and the dashboard stays empty, an ad blocker in your browser may be stopping the script. Turn the ad blocker off and try again, or load the script through a proxy on your own domain.

Does Loogika track member-only posts?

Yes. Loogika tracks a page behind the paywall like any other page, for the visitors who are able to view it.

Does Loogika track Portal and newsletter previews?

No. Ghost renders Portal and the newsletter previews in an iframe, and Loogika does not track them.