How Do We Integrate Google Analytic How Do We Integrate Google Analytic
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How Do We Integrate Google Analytic

Started by totalcollection, September 24, 2008, 07:15:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

totalcollection

I wonder where can we put google analytic code in CopperMind to collect visitors data. Where can we insert it to go with any theme?

Thanks in advance.
Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info

Sami

you can add it to each theme
{gallery-root}/themes/{your-theme}/template.html
Or you can add it to {gallery-root}/anycontent.php and then enable it at config=>Album list view=>The content of the main page
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

Instead of adding it to anycontent.php (which will only be taken into account for index files) I suggest to add the google analytics code to the custom footer. This way, it will be used no matter what theme you use. That's what I did for our demo: I used the config field "Path to custom footer include" and entered there the value ../custom_footer.php, as our demo gallery resides at http://coppermine-gallery.net/Obsolete, while the custom footer file resides at http://coppermine-gallery.net/demo/custom_footer.php
The custom footer file contains the tracker code.

Bottom line: for "regular" galleries, where you only have one theme and don't allow users to switch to another theme, just add the code of the tracker to themes/yourtheme/template.html. For galleries where users are allowed to choose from different themes, use the custom footer option.

However, this is not related at all to bridging, but to theming, so I'm moving your thread accordingly.

totalcollection

QuoteI used the config field "Path to custom footer include" and entered there the value ../custom_footer.php, as our demo gallery resides at http://coppermine-gallery.net/Obsolete, while the custom footer file resides at http://coppermine-gallery.net/demo/custom_footer.php
The custom footer file contains the tracker code.

You meant custom_footer.php is not included by default, but we must create it then put in the http://coppermine-gallery.net/demo/

with the code in it?
Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info

totalcollection

I got to config as instructed, but can't find where to call the custom footer file in?
I have attached my screenshot:
Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info


totalcollection

Thanks for pointing, but still not clear where to call that custom file.

QuotePath to custom header include

Optional relative path to a custom header file. Using this option, you can include non-coppermine code bits to be included into your theme, e.g. an overall navigation that gets included on your whole website. You can only add a relative path (seen from the root path of your coppermine install) - not an absolute one, nor a http include from another website. This option is only meant for experienced users who have some PHP know-how.

Warning: you mustn't include full html pages that contain an html header or footer (tags like <head> or <body>), nor can the included file do file header manipulation, e.g. reading another (non-coppermine) cookie.

[cpg1.4.0 or better required]
Path to custom footer include

Optional relative path to a custom footer file. The same remarks apply as for the custom header include path.

Sorry for any disturbing this may cause.
Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info

Gizmo

#7
It's right there in the image you posted. It's the last line in Config->Themes Settings. Create an file called footer.html and place your code in there without all the html tags.

[EDIT] I did a search form google analytics and got lots of hits. Here's one for you to start at.
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

totalcollection

Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info

totalcollection

Edit: I uploaded my custom_footer.php with google analytic code to the root, then enter custom_footer.php
Working fine.
Thx for all the supports.  :D
Total Wallpaper Collection
We collect everything for your desktop look and feel!
http://www.totalcollection.info

Joachim Müller

Thanks for resolving your thread. For others who come across this thread: it's much easier to add the code to themes/yourtheme/template.html, as suggested earlier. What the thread starter did will work, but is needlessly complicated.