Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Woopra tracking code - crashes xml packages

  1. #1
    press is offline Member
    Join Date
    May 2009
    Posts
    31

    Default Woopra tracking code - crashes xml packages

    I have been implementing some woopra to track my site. Overall, it works great on the static pages. But when i put the code in an xml package, it crashes it.

    Here is the code:

    <!-- Start of Woopra Code -->
    <script type="text/javascript">
    var woo_settings = {idle_timeout:'300000', domain:'mydomain.com'};
    (function(){
    var wsc = document.createElement('script');
    wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js';
    wsc.type = 'text/javascript';
    wsc.async = true;
    var ssc = document.getElementsByTagName('script')[0];
    ssc.parentNode.insertBefore(wsc, ssc);
    })();
    </script>
    <!-- End of Woopra Code -->


    Any ideas on how to make this work so i can tract the product pages?

    Preston

  2. #2
    press is offline Member
    Join Date
    May 2009
    Posts
    31

    Default re:Woopra tracking code

    Is anyone else using better tracking system on aspdnsf?

    Press

  3. #3
    ROBB is offline Senior Member
    Join Date
    Jun 2011
    Location
    United States
    Posts
    107

    Default WOOPRA Tracking Code

    Why not embed the code into your template.ascx/template.master instead?

    For the XML Package try wrapping the script code with <![CDATA[]]>, result would look like:

    Code:
    <!-- Start of Woopra Code -->
    <script type="text/javascript">
    <![CDATA[
    var woo_settings = {idle_timeout:'300000', domain:'mydomain.com'};
    (function(){
    var wsc = document.createElement('script');
    wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js';
    wsc.type = 'text/javascript';
    wsc.async = true;
    var ssc = document.getElementsByTagName('script')[0];
    ssc.parentNode.insertBefore(wsc, ssc);
    })();
    ]]>
    </script>
    <!-- End of Woopra Code -->

  4. #4
    press is offline Member
    Join Date
    May 2009
    Posts
    31

    Default why not indeed

    I did try the CDATA, but that did not work. So i put the code in the template.aspx.

    For some reason i did not figure the template would give all the details back to woopra, kind of thought i needed the code in every page. Glad i dont.

    It looks like the wsc.src = document.location.protocol+'//static.woopra.com/js/woopra.js'; is what reads the page name.

    Now just need to pull the woopra out of my static pages. fun.

    Thanks for the help.