Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 07-29-2014, 02:20 AM
chapiz's Avatar
chapiz chapiz is offline
Contributing Member
 
Join Date: 07-29-14
Posts: 93
iTrader: 0 / 0%
problems with google analytic

Hi I'm new to the forum, my problem is that when I copy the new google analytic code in my web <head>, website stops working.

anyone know how to fix this?

note: use PrestaShop 1.5.4.1
The website address is: maquinaria-taller.com


thanks.

Last edited by J. H. Rasmussen; 07-29-2014 at 04:13 AM. Reason: Moved to Coding Forum.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 07-29-2014, 04:15 PM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,998
iTrader: 1 / 100%
Looking in the source markup(code) of the frontpage, i can see some php-code:
PHP Code:
<?php include_once("analyticstracking.php"?>
For some reason, it hasn't been processed by php, so you probably added the code the wrong place.

I don't have a lot of experience with PrestaShop, but i could see that they have an adSense module, that may be a good way to add adSense to your website, for now it looks like there forum is down, so i can't provide a link to this module.

Anyway, it may be easier to help you, if you could tell us if you have any experience with adding adSense to your website, and do you have an approved adSense account?
 
Reply With Quote
  #3  
Old 07-29-2014, 10:56 PM
hirithk's Avatar
hirithk hirithk is offline
Contributing Member
 
Join Date: 04-11-12
Posts: 198
iTrader: 0 / 0%
Hi
As said above please try with that code, May be some problem in coding part, kindly check with the developer to fix the issues.
 
Reply With Quote
  #4  
Old 07-30-2014, 01:05 AM
chapiz's Avatar
chapiz chapiz is offline
Contributing Member
 
Join Date: 07-29-14
Posts: 93
iTrader: 0 / 0%
I have adsense account but this is an e commerce web and can not have adsense.

if I put the <script> the web does not work.

With the php code has not collected any data in two days.
 
Reply With Quote
  #5  
Old 07-30-2014, 12:37 PM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,998
iTrader: 1 / 100%
Could you post the Google Analytics javascript code you have tried to use on the website in a new reply to this thread?
 
Reply With Quote
  #6  
Old 07-30-2014, 05:57 PM
J. H. Rasmussen J. H. Rasmussen is online now
Super Moderator
 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 5,998
iTrader: 1 / 100%
lol i can see i talk about adSense in my first post in this thread, while the issue is about Google Analytics, sorry about that, i was a bit tired when i wrote that post.

So on topic, almost any website should be able to use Google Analytics, you just need to figure out where to add the code. I can see you're using the php version of the code, and it might be better to use the javascript version, especially if you need to add the code to a template. So where did you add the Google Analytics code, and what issue did you get because of it? E.g. did you add it to the template? And like i said in my previous post, if you could post the code you used in a new reply to this thread, then that would also help to figure out what the issue is.
 
Reply With Quote
  #7  
Old 07-31-2014, 01:55 AM
chapiz's Avatar
chapiz chapiz is offline
Contributing Member
 
Join Date: 07-29-14
Posts: 93
iTrader: 0 / 0%
I can not paste the code, or a photo, not a url

You are only allowed to post URLs to other sites after You have made ​​20 posts or more.

Code:
<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)},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-analytics.com/analytics.js','ga'); ga('create', 'UA-45280782-1', 'auto'); ga('send', 'pageview'); </script>
this is the code I'm trying to add.

I tried it on the head and below the body.

Code:
<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-45280782-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
This is the old code if it works.

could be conflicts with other scrip?

Last edited by snakeair; 07-31-2014 at 06:22 AM. Reason: merged posts - use the edit feature
 
Reply With Quote
  #8  
Old 08-14-2014, 02:05 AM
melissawetzel melissawetzel is offline
Contributing Member
 
Join Date: 08-08-14
Posts: 51
iTrader: 0 / 0%
You might not be receiving data as expected in your website, or the tracking status information might indicate that your website is not receiving data.
In this case, try to make troubleshoot settings properly. it may cause to stop the working.
 
Reply With Quote
  #9  
Old 09-03-2014, 03:53 AM
quickscrum quickscrum is offline
Junior Member
 
Join Date: 08-19-14
Location: Paris, France
Posts: 31
iTrader: 0 / 0%
Place your google analytics code into footer section before head. I think you will not getting problem after this.
 
Reply With Quote
  #10  
Old 09-03-2014, 05:19 AM
snakeair snakeair is offline
Super Moderator - Rest in Peace 2018
 
Join Date: 12-31-07
Location: Medford, NJ
Posts: 54,771
iTrader: 3 / 100%
Quote:
Originally Posted by quickscrum View Post
Place your google analytics code into footer section before head. I think you will not getting problem after this.
Has that worked for you?

Google recommends adding it before the </head> tags.

Quote:
4.Paste your snippet (unaltered, in itís entirety) into every web page you want to track. Paste it immediately before the closing </head> tag.
If you use templates to dynamically generate pages for your site (like if you use PHP, ASP, or a similar technology), you can paste the tracking code snippet into its own file, then include it in your page header.
Source: https://support.google.com/analytics.../1008080?hl=en
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
google analytic ankur12345 Google Forum 10 09-28-2010 12:08 AM
what is the use of google Analytic ssteven94 SEO Forum 20 09-14-2009 11:03 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 09:33 PM.
Powered by vBulletin
Copyright © 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC