• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding Google Analytics Info?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Adding Google Analytics Info?

This topic is: not resolved

Tagged: google analytics, tracking

  • This topic has 5 replies, 5 voices, and was last updated 4 years, 6 months ago by nirmal2me.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • August 8, 2016 at 3:06 pm #190934
    RavenManiac
    Participant

    What's the best way to add Google Analytics tracking info to a WordPress website?

    August 8, 2016 at 3:19 pm #190935
    Christoph
    Member

    Hi,

    if you don't want to use a plugin, you can add the code to Genesis - Theme Settings - Header and Footer Scripts - Header Scripts.


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    August 8, 2016 at 3:28 pm #190936
    RavenManiac
    Participant

    Yeah, that's my preference. Thanks!

    August 8, 2016 at 10:47 pm #190946
    jntufastupdates
    Member

    What's the best way to add Google Analytics Code info to a WordPress?


    Jntu Fast Updates

    February 19, 2017 at 7:53 am #201527
    famarinu
    Member

    Hi,
    I have been following this post to insert google analytics to my website.
    if I go to read the source code in the bowser I do not see it.
    The theme I use is lifestyle pro.
    If I want to add manually I have to use this method:

    add_action ('genesis_before', 'add_google_analytics_code');
    add_google_analytics_code function () {
    echo '<script>
       (Function (i, s, o, g, r, a, m) {i ['GoogleAnalyticsObject'] = r i [r] = i [r] || function () {
       (I [r] .q = i [r] .q || []). Push (arguments)}, the [r] .l = 1 * new Date (); a = s.createElement (o),
       m = s.getElementsByTagName (or) [0]; a.async = 1; a.src = g; m.parentNode.insertBefore (a, m)
       }) (Window, document, 'script', 'https: //www.google-analytics.com/analytics.js','ga');
    
       ga ('create', 'xxxxxxxxx', 'car');
       ga ('send', 'pageview');
    
    </ Script> ';
    }

    but it give me error, why?

    November 20, 2018 at 2:43 am #224465
    nirmal2me
    Participant

    I want to know which one is the easiest way to add Google Analytics to WordPress.

    exam result 2019

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble