How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Richard Your Own Question

Richard
Richard, Software Engineer
Category: Software
Satisfied Customers: 35377
Experience:  Software Systems Specialist.
32989067
Type Your Software Question Here...
Richard is online now

I need to use Google Analytics on my very basic WordPress website.

Resolved Question:

I need to use Google Analytics on my very basic WordPress website. GA have requested that I put the code below on every page that I want tracked. Where should this code be added?
Please note this is specific to a WordPress site. I'm not sure whether the code below will appear as given to me by Google.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-DANGEROUS URL REMOVED','ga');
ga('create', 'UA-***90456-2', 'auto');
ga('send', 'pageview');
Submitted: 1 year ago.
Category: Software
Expert:  Richard replied 1 year ago.
Thank you for your question, my name is ***** ***** I look forward to assisting you.
Please note, a rating is only needed when we are finished.
the code you have, paste it in your theme’s header.php right after the tag on your site.
Once added, save and it will then run each the page is opened.
Let me know the results please
Customer: replied 1 year ago.

Thank you for your quick reply, Richard. I've found the header.php, but what do you mean by the 'tag on your site'?

Also, as I'm dealing with WordPress and PHP (?) I'm a bit concerned about following their advice about php.

See: h t t p://postimg.org/image/hvanqgqnj/

Expert:  Richard replied 1 year ago.
ok, the text was removed here as its HTML but you copy this code
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-DANGEROUS URL REMOVED','ga');
ga('create', 'UA-***90456-2', 'auto');
ga('send', 'pageview');
after the
Body
Tag that's in the brackets
Customer: replied 1 year ago.

Thanks - and the php query?

Expert:  Richard replied 1 year ago.
No as they are doing it a different way to how we are, the way I have you do it is simpler.
Richard, Software Engineer
Category: Software
Satisfied Customers: 35377
Experience: Software Systems Specialist.
Richard and other Software Specialists are ready to help you

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer
< Previous | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C.
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C.
 
 
 

Meet The Experts:

 
 
 
  • Steve Herrod

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    160
    Familiar with a wide variety of software and experienced in user training/support
< Previous | Next >
  • http://ww2.justanswer.co.uk/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    160
    Familiar with a wide variety of software and experienced in user training/support
  • http://ww2.justanswer.co.uk/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    116
    Computer Software Support specialist for more that 10 years
  • http://ww2.justanswer.co.uk/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    114
    Certified Software expert with over 10 years experience.
  • http://ww2.justanswer.co.uk/uploads/FS/fszcze/2012-6-18_181848_500test.64x64.jpg Frederick S's Avatar

    Frederick S

    Computer Specialist

    Satisfied Customers:

    91
    Computer technician; founder of a home PC repair company.
  • http://ww2.justanswer.co.uk/uploads/WA/wa94sound/2012-6-6_202633_iStock000007010121Small.64x64.jpg Bernie's Avatar

    Bernie

    Software Support

    Satisfied Customers:

    52
    6+ years experience, Microsoft MCDST/CompTia A+ Certified
  • http://ww2.justanswer.co.uk/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Software Engineer

    Satisfied Customers:

    38
    20 years experience providing remote computer support
  • http://ww2.justanswer.co.uk/uploads/jnayes/2010-12-23_132454_japicbetter.jpg jnayes's Avatar

    jnayes

    Computer Support

    Satisfied Customers:

    37
    Network Administrator
 
 
 

Related Software Questions