[Opa] Google Analytics
Adam Koprowski
Adam.Koprowski at mlstate.com
Wed Oct 19 09:04:19 EDT 2011
Dear Tim,
Quick & dirty approach: put this script in a separate .js file, make it
available as an application external
resource<http://blog.opalang.org/2011/07/image-part-1-dealing-with-external.html>
and
use it with a standard <script> tag.
A better way to do that would be to interface this functionality via an
Opa plugin <http://doc.opalang.org/#_bindings_with_other_languages>, that
could then be made available to the community, or maybe even included in the
standard library (in stdlib.api).
Hope that helps,
Adam
On Tue, Oct 18, 2011 at 19:25, Tim Cotten <tcotten at bigi.co> wrote:
> Hi all,
>
> Does anyone have any idea how to embed the Google Analytics JS code in each
> page being served?
>
> For reference:
>
> <script type="text/javascript">
>
> var _gaq = _gaq || [];
> _gaq.push(['_setAccount', 'ACCOUNTIDHERE']);
> _gaq.push(['_trackPageview']);
>
> (function() {
> var ga = document.createElement('script'); ga.type = 'text/javascript';
> ga.async = true;
> ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '
> http://www') + '.google-analytics.com/ga.js';
> var s = document.getElementsByTagName('script')[0];
> s.parentNode.insertBefore(ga, s);
> })();
>
> </script>
>
> _______________________________________________
> Opa mailing list
> Opa at lists.owasp.org
> https://lists.owasp.org/mailman/listinfo/opa
>
>
--
*Adam Koprowski [http://adam-koprowski.net]
Opa Tech Evangelist @ MLstate [http://opalang.org | http://mlstate.com]*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.owasp.org/pipermail/opa/attachments/20111019/6091b0f4/attachment.html
More information about the Opa
mailing list