Error in javascript tracker

I am getting an error whenever I use the javascript tracker. The error is in line 54, Column 672 on the following call:


The error message is

sp.js - Uncaught InvalidStateError: Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.q @ sp.js:onreadystatechange @ sp.js

Here is my initialization code:

<!-- Snowplow starts plowing -->
<script type="text/javascript">
(function () {
    window.spvb('newTracker', 'co', '', { // Initialise a tracker
      appId: 'az-viewbix-player', // Application ID can be anything you want
      platform: 'web', // Do not change
post: true,      // Use POST rather than GET
bufferSize: 1,    // Wait for 5 events to be recorded then send them all into Snowplow via a single POSTS request. You can set this to whatever you want -  if you don't set it it will defuault to 1
cookieName: "_vbtrck_" // Name the viewbix cookie. This will prevent another Snowplow tracker writing to the same cookie, e.g. if a Viewbix ad unit is shown on a publisher site where Snowplow is running
<!-- Snowplow stops plowing -->

We call the tracker like this:

  'trackUnstructEvent', {
      'schema': mySchema
      , 'data': myData}
  , myContexts);

Please help.

From discussing this offline (the poster is a Snowplow customer), it looks like this is a CORS issue from running the Snowplow JavaScript Tracker from a local development machine.

If you encounter this, please check out: