Sign up for a Google Analytics account if you have not already done so.
Log in and retrieve your UA code. This is a code with a format that looks like “UA-12345678-1”.
Go to the Plugins menu and activate Google Analytics for WordPress if it is not already activated.
Go to the Settings > Google Analytics menu.
Check the box “Manually enter your UA code.”
Paste your UA code into the text box.
Check the box “Show advanced settings.”
Under the Advanced Settings panel:
Next to “Ignore users,” select “Editor” from the drop-down menu.
Next to “Track full URL of outbound clicks or just the domain,” select “Track the complete URL.”
Click the button “Update Google Analytics Settings.”
More information: https://wordpress.org/plugins/google-analytics-for-wordpress/