Last active
November 1, 2024 15:50
-
-
Save kevinlisota/8fd6a90b5e93312413bf to your computer and use it in GitHub Desktop.
add WordPress author tracking using Google Analytics custom dimension
This goes in your WordPress theme's functions.php file. Obviously you need to enter your own Google Analytics property ID, and you also need to make sure that the dimension index number matches what you setup in your Google Analytics property.
If your theme already has Google Analytics tracking code, or if you are using some sort of Google Analytics plugin that drops the GA snippet on your page, you'll have to either remove that or customize it. This snippet would add duplicate tracking code in that case, which is not what you want.
Here's an article where I walk through the process of setting this up: http://www.geekwire.com/devblog/add-wordpress-author-tracking-google-analytics-using-custom-dimensions/
dude, syntax errors abound
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm interested in using this and have added the custom definition / custom dimension
Where would I place this code to have it work?