Jump to content

Adding analytics (not Google analytics)


Steve llea

Recommended Posts

Hi all,

Sorry if this has been asked before... I can see how to add Google Analytics to my store, but I don't want to use Google. I want to use Piwik, which works in a similar way. Piwik provides some javascript code that I need to include in each page that I want to track. It would've been nice if instead of entering just the 'Google Analytics ID' in the CC admin panel you could instead just enter the block of javascript that Google or any other stats/tracking provider gives you. But, it looks like I will need to do it manually. What's the bast approach? Should I be looking at editing the templates and/or the php? And will any changes I make be lost when CC is updated?

Thanks for any advice you can give:)

Steve

Link to comment
Share on other sites

Welcome to the forums, @Steve llea!

Most of the time when you want something to load on every page from the storefront, it needs to be added to main.php in your skin templates.

I don't understand when it's needed and when it's not, but I always seem to end up enclosing the javascript in {literal} {/literal} tags. Sometimes it needs to be in the header, others near the end. Hopefully Piwik makes that clear - of course there's always trial and error. Just be sure, whatever you try, to be sure all cache in CC (except images) and browser are cleared after each change. Temporarily disabling cache would help while testing.

As for being lost on upgrade - yes, if you keep the Foundation name for your skin. If you copy the Foundation and rename it, making appropriate naming changes in the skin config file - your copy will not be overwritten on upgrade. That means you have to manually make any skin changes an upgrade might have in it (but they are relatively rare).

According to Piwik's directions - https://piwik.org/docs/installation/#getting-started

Quote

We recommend that you paste this code immediately before your closing </head> tag (or in a general header file that is included at the top of all your pages).

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...