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.
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 (//http://)
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.
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?
I got to config as instructed, but can't find where to call the custom footer file in?
I have attached my screenshot:
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_theme_include_path_start
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.
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 (http://forum.coppermine-gallery.net/index.php/topic,39898.0.html) for you to start at.
Do I have to enter absolute path: http://coppermine-gallery.net/demo/custom_footer.php
Thanks in advance
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
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.