Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

Google Analytics doesn't work
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Google Analytics doesn't work

Google Analytics doesn't work 11 years ago #8520

Hi,
I did enable Google Analytics and enter Google Tracking ID in to SJ Health Template but it doesn't work (Google Analytics reports Tracking Not Installed). Do I need to do anything else?
The topic has been locked.

Re: Google Analytics doesn't work 11 years ago #8555

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Hoang Chu,

Please check Google Tracking ID again.

Did you do exactly the steps yet?

Thanks
Ticket System | Join our Clubs to download our extensions and templates
The topic has been locked.

Re: Google Analytics doesn't work 11 years ago #8559

Hi,
The tracking ID is correct.
I did as shown in the attachment. What steps do you mention?
I checked the home page (view source) and found the code but looks like it couldn't get the tracking ID correctly.
_gaq.push(["_setAccount", "'.$yt->getParam('googleAnalyticsTrackingID').'"]);

Can I hardcode the tracking ID? Could you show me where is the JavaScript file?
Thanks
The topic has been locked.

Re: Google Analytics doesn't work 11 years ago #8574

  • loitt
  • OFFLINE
  • Platinum Boarder
  • Posts: 2222
  • Karma: 48
Dear Hoang Chu,

Please try to go to "templates\sj_health\includes\head.php", finding:

<script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(["_setAccount", "'.$yt->getParam('googleAnalyticsTrackingID').'"]);
        _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>	


change to:

<script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(["_setAccount", "<?php echo $yt->getParam('googleAnalyticsTrackingID');?>"]);
        _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>		


Thanks
Ticket System | Join our Clubs to download our extensions and templates
The topic has been locked.
The following user(s) said Thank You: andyricor

Re: Google Analytics doesn't work 11 years ago #8586

Thanks for your help. At least View Source now can show correct Tracking ID. I'll check Google Analytics later.
The topic has been locked.
The following user(s) said Thank You: andyricor

Re: Google Analytics doesn't work 11 years ago #8588

It's working now. Thanks again.
The topic has been locked.
  • Page:
  • 1
Time to create page: 0.22 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes