Hi,
i am learning how to embed piwik widgets.
i’ve read that i can “embed” them in several ways:
- passing the security token, useful on “private” pages
- without the security token, useful on “public” pages, but i need to allow at least “read” for anonymous users…
well, i was thinking instead to use PHP (passing widget url with my secret token to file_get_contents…) to get the widget HTML and then embed only the resulting HTML on a web page, i tried and it… kinda works, but style and behaviour is broken, i think because some css and js file in the widget HTML are linked using relative urls
like
<link rel="stylesheet" type="text/css" href="index.php?module=Proxy&action=getCss&cb=d507bfb5bdcd3ffe650529b5fb1b6537" />
and the same for all the graphic elements of the widget, like
<img class="sparkline" alt="" src="?module=VisitsSummary&token_aut.....
the widget HTML, with relative links, of course works perfectly in IFRAME tags, because they use an absolute SRC attribute, and inside IFRAMES all relative links are resolved to that absolute SRC, but in my case i get weird things because those relative links are resolved against my PHP script absolute URL, which has nothing to do with my piwik server URL…
Would it be possibile to use a GET parameter in the widget callin URL to have absolute links? And would they work?
Thanks,
Marco