Only Global Admins can change these settings, from the admin dashboard. > Click the "Administration" section. > then Click the "Site Settings" icon.
Under the Advertisement & Marketing header You will see a question called "Google Analytics Script:"you add this script here.