Topic: where to put Clicky tracking link?

http://getclicky.com/help/#website
Here^ Clicky Analytics says to put their tracking link right before the </body> tag on a given html page.  What does that mean in terms of a simpleviewer gallery?  Before the </body> Index.php?  Thanks!

Last edited by brasmasus (2011-11-30 20:22:13)

Re: where to put Clicky tracking link?

Before the </body> Index.php?

As a standard SimpleViewer gallery does not contain PHP pages, it would appear that you are embedding a gallery in your own PHP page ('Index.php'). This page should contain a </body> tag and your Clicky code should be placed immediately before it. Depending on how your PHP page is constructed, you may need to break out of PHP code to insert your Clicky code.

Steven Speirs
SimpleViewer Support Team.

Re: where to put Clicky tracking link?

Steven Speirs wrote:

Before the </body> Index.php?

As a standard SimpleViewer gallery does not contain PHP pages, it would appear that you are embedding a gallery in your own PHP page ('Index.php'). This page should contain a </body> tag and your Clicky code should be placed immediately before it. Depending on how your PHP page is constructed, you may need to break out of PHP code to insert your Clicky code.

Hi Steven,
I'm not embedding; I just noticed that there was an index.php at [galleryname]/index.php
Where would I put it in a standard simpleviewer gallery?

Re: where to put Clicky tracking link?

Are you using a template or script to create your SimpleViewer gallery?
I do not know where your 'index.php' file comes from.
Please post the code of your 'index.php' page so that I can take a look.

Where would I put it in a standard simpleviewer gallery?

Immediately before the closing </body> tag in the gallery's 'index.html' file (which will be directly inside the gallery folder if creating a gallery with svBuilder-Pro).

Steven Speirs
SimpleViewer Support Team.

Re: where to put Clicky tracking link?

I'm using svmanager.  I guess this looks like I'm embedding, but the URLs are just like www.site.com/svmanager/g11
Here's an index.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" >
    <?php
      /* Leave this block of php code intact if customizing this page */
      error_reporting(0);
      $preferences = file_get_contents('preferences.txt');
      $preferences = unserialize($preferences);
      $title = htmlspecialchars($preferences['htmlTitle'], ENT_QUOTES, 'UTF-8');
      $galleryWidth = isset($preferences['galleryWidth']) ? "'".$preferences['galleryWidth']."'" : "'100%'";
      $galleryHeight = isset($preferences['galleryHeight']) ? "'".$preferences['galleryHeight']."'" : "'100%'";
      $useFlash = isset($preferences['useFlash']) ? strtolower($preferences['useFlash']) : 'true';
      $backgroundColor = isset($preferences['backgroundColor']) ? $preferences['backgroundColor'] : '0x222222';
      $backgroundColor = "'".ltrim(str_replace('0x', '', $backgroundColor), '#')."'";
      $flashVars = 'null';
      $params = 'null';
      $attributes = 'null';
      $useColorCorrection = isset($preferences['useColorCorrection']) ? strtolower($preferences['useColorCorrection']) : 'true';
    ?>
    <title><?php print $title; ?></title>
  </head>
  <body>
    <!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
      var flashvars = {};
      flashvars.galleryURL = "gallery.xml?nocache=<?php echo rand(); ?>";
      simpleviewer.ready(function () {
        simpleviewer.load(
          'sv-container',
          <?php print $galleryWidth; ?>,
          <?php print $galleryHeight; ?>,
          <?php print $backgroundColor; ?>,
          <?php print $useFlash; ?>,
          <?php print $flashVars; ?>,
          <?php print $params; ?>,
          <?php print $attributes; ?>,
          <?php print $useColorCorrection; ?>
          );
      });
    </script>
    <div id="sv-container"></div>
    <!--END SIMPLEVIEWER EMBED -->
  </body>
</html>

Re: where to put Clicky tracking link?

I'm using svmanager.

Thank you for this information.
If you wish to include a chunk of code in the index pages of all your galleries created by svManager, then you should insert the code immediately before the closing </body> tag in the 'svmanager\plugins\simpleviewer2\sv2master\index.php' file.

Steven Speirs
SimpleViewer Support Team.

Re: where to put Clicky tracking link?

Steven Speirs wrote:

I'm using svmanager.

Thank you for this information.
If you wish to include a chunk of code in the index pages of all your galleries created by svManager, then you should insert the code immediately before the closing </body> tag in the 'svmanager\plugins\simpleviewer2\sv2master\index.php' file.

wow that sounds easy

Re: where to put Clicky tracking link?

Hi Steven,
I did that^ a few days ago but no galleries show up in the Clicky results.  Everything else does though and I'm positive they're getting plenty of traffic.  Not sure if it helps, but this is the Clicky tracking code:

<a title="Web Analytics" href="http://getclicky.com/[my clicky number]"><img alt="Web Analytics" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init([my clicky number]); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/[my clicky number]ns.gif" /></p></noscript>

Last edited by brasmasus (2011-12-04 15:20:58)

Re: where to put Clicky tracking link?

Please post the URL to one of your galleries so that we can take a look.

Steven Speirs
SimpleViewer Support Team.

Re: where to put Clicky tracking link?

Steven Speirs wrote:

Please post the URL to one of your galleries so that we can take a look.

here's one: http://borderlandsbestgear.com/svmanager/g2/

Re: where to put Clicky tracking link?

If you view the source of the gallery's 'index.php' page, the code after the gallery's embedding code and before the closing </body> tag does not look like the Clicky code you posted.
Make sure the correct code is being entered into the 'svmanager\plugins\simpleviewer2\sv2master\index.php' file (and that it is not within <?php ?> tags).

Steven Speirs
SimpleViewer Support Team.

Re: where to put Clicky tracking link?

Hi Steven,
I doublechecked the live index.php at that location^ and this is what it has been for the last few days:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" >
    <?php
      /* Leave this block of php code intact if customizing this page */
      error_reporting(0);
      $preferences = file_get_contents('preferences.txt');
      $preferences = unserialize($preferences);
      $title = htmlspecialchars($preferences['htmlTitle'], ENT_QUOTES, 'UTF-8');
      $galleryWidth = isset($preferences['galleryWidth']) ? "'".$preferences['galleryWidth']."'" : "'100%'";
      $galleryHeight = isset($preferences['galleryHeight']) ? "'".$preferences['galleryHeight']."'" : "'100%'";
      $useFlash = isset($preferences['useFlash']) ? strtolower($preferences['useFlash']) : 'true';
      $backgroundColor = isset($preferences['backgroundColor']) ? $preferences['backgroundColor'] : '0x222222';
      $backgroundColor = "'".ltrim(str_replace('0x', '', $backgroundColor), '#')."'";
      $flashVars = 'null';
      $params = 'null';
      $attributes = 'null';
      $useColorCorrection = isset($preferences['useColorCorrection']) ? strtolower($preferences['useColorCorrection']) : 'true';
    ?>
    <title><?php print $title; ?></title>
  </head>
  <body>
    <!--START SIMPLEVIEWER EMBED -->
    <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
    <script type="text/javascript">
      var flashvars = {};
      flashvars.galleryURL = "gallery.xml?nocache=<?php echo rand(); ?>";
      simpleviewer.ready(function () {
        simpleviewer.load(
          'sv-container',
          <?php print $galleryWidth; ?>,
          <?php print $galleryHeight; ?>,
          <?php print $backgroundColor; ?>,
          <?php print $useFlash; ?>,
          <?php print $flashVars; ?>,
          <?php print $params; ?>,
          <?php print $attributes; ?>,
          <?php print $useColorCorrection; ?>
          );
      });
    </script>
    <div id="sv-container"></div>
    <!--END SIMPLEVIEWER EMBED -->
  <a title="Real Time Web Analytics" href="http://getclicky.com/66497044"><img alt="Real Time Web Analytics" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(66497044); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/66497044ns.gif" /></p></noscript>
</body>
</html>

?

EDIT: weird - I just checked and it looks like that one particular gallery - g2 - shows a visit today - but no other galleries.  I'm certain that other galleries have gotten dozens of visits.  I reset a cache earlier today so maybe that has something to do with it(?).  I'll update what I'm seeing tomorrow.

Last edited by brasmasus (2011-12-05 02:30:18)

Re: where to put Clicky tracking link?

UPDATE: no additional gallery page visits were tracked.

Not sure what the deal is with g2 yesterday.  Fwiw that's the only gallery that's embedded in a page, and that page is the home page, which gets more traffc than anything else.  Why it logged a single visit yesterday alone doesn't immediately make sense given that there has been no change to the home page or g2 for several days.

Re: where to put Clicky tracking link?

When viewing the source of the 'g2/index.php' page, I see the following:

<script type="text/javascript">
//<![CDATA[
window.__CF=window.__CF||{};window.__CF.u="/cdn-cgi/async/cf/uri/";window.__CF.p="9e/03d1a7ab31176e9e0ee1c0ca9bb818";window.__CF.o=1;window.__CF.c=0;(function(){var a=document,b=a.createElement("script");b.src="//ajax.cloudflare.com/cdn-cgi/nexp/v=918368360/cf_tools.min.js";b.setAttribute("async","true");a=a.getElementsByTagName("script");a=a[a.length-1];a.parentNode.insertBefore(b,a)})();
//]]>
</script>

... where I would expect to see:

<a title="Web Analytics" href="http://getclicky.com/[my clicky number]"><img alt="Web Analytics" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init([my clicky number]); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/[my clicky number]ns.gif" /></p></noscript>

Likewise with the 'g1' gallery.
However, when I visit http://borderlandsbestgear.com/svmanage … /index.php directly, although no gallery is displayed (which is expected), the source of the page shows the following:

<a title="Real Time Web Analytics" href="http://getclicky.com/66497044"><img alt="Real Time Web Analytics" src="//static.getclicky.com/media/links/badge.gif" border="0" /></a>
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(66497044); }catch(e){}</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/66497044ns.gif" /></p></noscript>
<script type="text/javascript">
//<![CDATA[
window.__CF=window.__CF||{};window.__CF.u="/cdn-cgi/async/cf/uri/";window.__CF.p="9e/03d1a7ab31176e9e0ee1c0ca9bb818";window.__CF.o=1;window.__CF.c=0;(function(){var a=document,b=a.createElement("script");b.src="//ajax.cloudflare.com/cdn-cgi/nexp/v=918368360/cf_tools.min.js";b.setAttribute("async","true");a=a.getElementsByTagName("script");a=a[a.length-1];a.parentNode.insertBefore(b,a)})();
//]]>
</script>

... ie. what I would expect to see (your Clicky code) as well as the code from the 'g1' and 'g2' galleries.
I do not know if it will help but I hope this observation proves useful in tracking down the problem.

Steven Speirs
SimpleViewer Support Team.