Title: Google Analytics script
Last modified: May 25, 2018

---

# Google Analytics script

 *  Resolved [merock](https://wordpress.org/support/users/merock/)
 * (@merock)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/)
 * Hey Guys, me again 🙂
 * In the Analytics section of the plugin configuration i just pasted this script:
 * —————-
    <script type=”text/javascript”>
 *  var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘XXXXXX’]); _gaq.push([‘_trackPageview’]);
 *  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’;
   ga.async = true; ga.src = (‘https:’ == document.location.protocol ? ‘[https://ssl&#8217](https://ssl&#8217);:‘
   [http://www&#8217](http://www&#8217);) + ‘.google-analytics.com/ga.js’; var s
   = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);})();
 * </script>
 * ————–
    XXXX = my google analytics account.
 * Is this correct? will this do the work fine? Do I neeed to do anything else? 
   Anything to remove or edit on the site..? What a headache 😛
 * Thanks x1000 in advance guys.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Joe Hana](https://wordpress.org/support/users/joehana/)
 * (@joehana)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10320977)
 * Yeah should be fine. Try testing it by using private mode of your browser, navigate
   to your website, enable the cookies through the modal and check if GA tracks 
   your visit. Then close the private mode, open it again (that way all cookies 
   are gone) and try the same again but with disabled cookies and check if GA still
   tracks your visit.
 *  Thread Starter [merock](https://wordpress.org/support/users/merock/)
 * (@merock)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10320980)
 * Hey Joen, Thanks for the tip, simple and clever.
    Thank you!
 *  [wwwerki](https://wordpress.org/support/users/wwwerki/)
 * (@wwwerki)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10322001)
 * Hi, I tried to insert the code above with my Google Analytics Code to the Third
   Party HEAD section of the plugin. But when I test it via my browser it doesn’t
   work… Could you please help me? Do I have to deactivate anything in my Google
   Analytics plugin or add/personalize the code above?
    Thanks in advance for your
   help! wwwerki
 *  [rocked18](https://wordpress.org/support/users/rocked18/)
 * (@rocked18)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10322724)
 * plugin is bust – there is a workaround that someone made – check the other threads
   to find it
 *  [MA](https://wordpress.org/support/users/gasparnemes/)
 * (@gasparnemes)
 * [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10361090)
 * Hi there,
 * Thanks for your comments.
 * Our plugin loads the script with Javascript, and that’s why you can’t find it
   in the view-source page. You can try the developer console in Chrome (inspect
   element) and find the scripts.
 * Also, check the realtime overview in your Google Analytics account, and should
   work.
 * I hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Google Analytics script’ is closed to new replies.

 * ![](https://ps.w.org/gdpr-cookie-compliance/assets/icon-256x256.png?rev=2376316)
 * [GDPR Cookie Compliance - Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law](https://wordpress.org/plugins/gdpr-cookie-compliance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gdpr-cookie-compliance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gdpr-cookie-compliance/)
 * [Active Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)

 * 5 replies
 * 5 participants
 * Last reply from: [MA](https://wordpress.org/support/users/gasparnemes/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/google-analytics-script-4/#post-10361090)
 * Status: resolved