Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 13117

Re: Piwik 1.10 Page Overlay

$
0
0
Hey Folks,

Waited patiently for rtelease 1.12 and installed today.

We have piwik sitting behind a firewall. we expose a single directory /path/to/piwik/public and build symbolic links to piwik.js and piwik.php this methods has worked for tracking but not page overlays.

external: geogratis.gc.ca/track leads to the js and php files publicly.

internal: dashboard.geogratis.gc.ca should point to the internal files

What follows are two code snippets I tried. The first one works for tracking external traffic but not page overlays. The second one works for page overlays but tracks only internal traffic.

sample 1:
-----------------
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://geogratis.gc.ca/track/" ;
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "30"]);
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>

sample 2:
----------------
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["trackPageView"]);
  _paq.push(["enableLinkTracking"]);

  (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "://dashboard.geogratis.gc.ca/" ;
    _paq.push(["setTrackerUrl", u+"piwik.php"]);
    _paq.push(["setSiteId", "30"]);
    _paq.push(["setAPIUrl", "http://dashboard.geogratis.gc.ca/"])
    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
    g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
  })();
</script>

Any thoughts?

Also, to clarify the function is setAPIUrlk and NOT setApiUrl (notice cammel case)


Thanks in advance

Viewing all articles
Browse latest Browse all 13117

Trending Articles