Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:08:18+00:00 2026-06-11T00:08:18+00:00

I have a tracking script on an E-commerce site receipt page. The script simply

  • 0

I have a tracking script on an E-commerce site receipt page. The script simply fetches the product information from the DOM and tracks it using the Piwik E-commerce tracking functions. This works fine in all browsers except Internet Explorer 8 and below. I’ve been trying to figure out what’s wrong with the script for weeks. I’ve tested it locally on a dummy receipt page and it works fine in IE, but it’s not tracking any sales for IE 5-8 on the live page.

The tracking script is inserted to the receipt page via an OpenTag tag and so is piwik.js, but I’m using the asynchronous tracker so that shouldn’t be an issue, as all browsers except IE confirms.

Here is the code that is injected via OpenTag:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript">
    // Closure that supports jQuery
    (function($) {
        // Function for removing everything from a string except numbers and
        // returning that number as an integer
        var num = function(text) {
            return parseInt(text.replace(/[^0-9]/g, ''));
        };

        // Trims whitespace from before and after a string. "  hello  " => "hello"
        var trim = function(text) {
            return text.replace(/^\s+|\s+$/g, '');
        };

        // Run on document ready
        $(function() {

            // Ready a reference to Piwik async queue
            _paq = _paq || [];

            // Referansenummeret
            var order_id = num(
                $('span#ctl00_CPHCnt_McInPlaceEdYourRefNbr_McInPlaceEdYourRefNbr')
                .closest('p').text()
            );

            // Hent verdien som ligger etter "Total:"
            // var total = num(
            //     $('span#ctl00_CPHCnt_HandlevognProdukListe1_McInPlaceEdTotInclAVT2_McInPlaceEdTotInclAVT2')
            //     .closest('tr').children('td:last-child').text()
            // );
            var total = 0;

            // Hent verdien som ligger etter "Sum:"
            var sub_total = num(
                $('span#ctl00_CPHCnt_HandlevognProdukListe1_McInPlaceEditorSum_McInPlaceEditorSum')
                .closest('tr').children('td:last-child').text()
            );

            // Hent verdien som ligger etter "Herav mva:"
            var mva = num(
                $('table.CartSummaryTable .TotalValue').closest('tr').next()
                .children('td:last-child').text()
            );

            // Hent verdien som ligger etter "Frakt inkl. evt. gebyr:"
            var shipping = num(
                $('span#ctl00_CPHCnt_HandlevognProdukListe1_McInPlaceEdFreightInclFee_McInPlaceEdFreightInclFee')
                .closest('tr').children('td:last-child').text()
            );

            // Cheat solution - the total doesn't have a 100% hitrate so just
            // add the sub_total and shipping together.
            total = sub_total + shipping;

            // Iterate over the product rows and extract the information
            $('table#ProductList tr.VerticalText').each(function(index, row) {
                var sku = trim($('td:first-child', row).text());
                var prod_name = trim($('div.ProduktDesc span', row).text());
                var categories = [];
                var price = num($('td:nth-child(5)', row).text());
                var quant = num($('td:nth-child(4)', row).text());

                // Extrapolate categories from the product link URL
                var path = $('.ProduktDesc a', row).attr('href').split('/');
                for(var i = 2; i < path.length - 1; i++)
                {
                    categories.push(path[i]);
                }

                // Track this product
                _paq.push(['addEcommerceItem', sku, prod_name, categories, price, quant]);
            });

            // Track this order
            _paq.push(['trackEcommerceOrder', order_id, total, sub_total, mva, shipping, false]);
        });
    }(window.jQuery.noConflict(true)));
</script>

Asking on StackOverflow is my last resort, I can’t for the life of me figure out why this isn’t tracking any sales for Internet Explorer 5-8.

I’ll accept the first answer that leads me to solve this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:08:20+00:00Added an answer on June 11, 2026 at 12:08 am

    We figured it out. It turns out OpenTag was transforming the URL “//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js” into “////ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js” only in Internet Explorer. We solved it by figuring out the protocol using JavaScript instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage from the Fogbugz bug tracking system, and using a plugin
I have been tracking emails for years using a "beacon" image and for those
I have a change tracking framework that tracks changed made to domain objects on
I have implemented an XMLHttpRequest() call to a standalone html page which simply has
I'm developing an e-commerce using Wicket to render pages. I have a BasePage with
I am trying to build a script that posts information into the RoyalMail tracking
We have an older site which still uses the ancient gat Analytics tracking code
I have installed the below google tracking code in my site var _gaq =
I have a site with a third-party Javascript include coming from an external URL.
I'm migrating my Google Analytics from Traditional to Asynchronous tracking. I now have my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.