Site logo

Archived topic

Google analytics code in hook / wp_head

1 reply · Started by Kristian on September 16, 2019

Viewing posts 1–2 of 2

i would like to use hook instead of installing a plugin to add the Google Analtyics code on my site: https://vpnservice.dk/
Will it work to add the analytics code in hook / wp_head and then display on entire_site?

Hi there,

yes, thats correct, the WP_head hook is within the <head> element of the site.
Then set Display Rules for the Entire Site.

Extra bonus, on the Display Rules set User > Logged Out - this will stop the script from running for Authority ( Logged in ) users.

This archived topic is closed to new replies.