| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Insert Tracking Code In All Pages | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Insert Tracking Code In All Pages
I use Piwik for my analytics instead of Google Analytics and I would like to find a way to add the tracking code to all pages. I need to add the JavaScript Tracking Code somewhere where it adds it to all pages of the site right before the /<body> tag.
Any help would be appreciated. |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Insert Tracking Code In All Pages
Hi!
1) You can put your JS code into the Custom JS field of theme tweaker module (System settings > Look & feel > Custom JS in admin area). 2) if you were provided with code like <script src="http://path.to/some/script.js">, it would not work out, because this is HTML code actually and you need to apply the approach descirbed here: http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings 3) You can also include JS code like this: http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#3
|
|||||||
|
|||||||
Re: Insert Tracking Code In All Pages
I copied the provided code like this that pulls from another site, added it to the custom js area under look and feel, then rebuilt cache and it did not work. Maybe this will help
<!-- Custom JS --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//tracker.com/"; _paq.push(['setTrackerUrl', u+'clienttype.php']); _paq.push(['setSiteId', 27]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//tracker.com/clienttype.php?idsite=27" style="border:0;" alt="" /></p></noscript> <!-- End Custom JS --> Or a detailed explanation instead of a link, thank you |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Insert Tracking Code In All Pages
This is not pure JS code, because it has this <script> and <noscript> tags.
Use the solution described here: http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings and it will work out. Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#5
|
|||||||
|
|||||||
Re: Insert Tracking Code In All Pages
Ok, so this code is mainly for a developer, not the average person to add something to their site on all pages. I think it would be great if this was automatically added to xcart 5 so that the average person can add or remove code they need on all pages like for the header or footer...
|
|||||||
#6
|
|||||||||
|
|||||||||
Re: Insert Tracking Code In All Pages
I agree, it would be convenient to have such feature. Please post an idea to ideas.x-cart.com.
Anyway, I feel, that your task is quite simple and you can accomplish it without any PHP knowledge. If you want I can guide you through the process. Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#7
|
|||||||
|
|||||||
Re: Insert Tracking Code In All Pages
That would be much appreciated, what do you need me to do to get started? Thank you
|
|||||||
#8
|
|||||||||
|
|||||||||
Re: Insert Tracking Code In All Pages
Yyou can just use the module from here:
http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings#Step4-workingwithsettings-Moduleexample Download it, install on your X-Cart and put the tracking code to the textarea option of this module. This is the simplest solution. Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#9
|
|||||||
|
|||||||
Re: Insert Tracking Code In All Pages
Ok, I have downloaded https://dl.dropboxusercontent.com/u/23858825/Tony-SettingsDemo-v5_1_0.tar
How do I install when not automatic through the marketplace? Thanks for your help BTW... |
|||||||
#10
|
|||||||||
|
|||||||||
Re: Insert Tracking Code In All Pages
Installed modules page - there is a button "upload module". If you are on the hosted XC5 version then you are out of luck - the only way would be to ask QT to install it for you.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|