Can 1 web app have multiple statcounter projects?

Discussion in 'Help' started by Mapping Support, Feb 25, 2017.

  1. Mapping Support

    Mapping Support New Member

    Joined:
    Jan 24, 2011
    Messages:
    11
    Likes Received:
    0
    I have a browser app called Gmap4 that is based on the Google map API.
    Since Gmap4 can be used in several different ways, I set up several statcounter projects.

    Is statcounter supposed to handle something like the following?
    The problem is that I get hits showing up in project 1111111 that should not be there.

    var sc_project=0;
    var sc_invisible=0;
    var sc_security="0";
    if (map = "A") {
    sc_project=1111111;
    sc_invisible=1;
    sc_security="_________";
    } else if (map = "B") {
    sc_project=2222222;
    sc_invisible=1;
    sc_security="________";
    } else {
    // Everything else.
    sc_project=3333333;
    sc_invisible=1;
    sc_security="________";
    }
    scJsHost = (("https:" == document.location.protocol) ?
    "https://secure." : "http://www.");
    document.write("<sc"+"ript type='text/javascript' src='" +
    scJsHost+
    "statcounter.com/counter/counter.js'></"+"script>");
     
  2. webado

    webado Moderator

    Joined:
    Apr 29, 2004
    Messages:
    28,159
    Likes Received:
    1
    You can do that assuming your variable map is properly defined :)
     
  3. Mapping Support

    Mapping Support New Member

    Joined:
    Jan 24, 2011
    Messages:
    11
    Likes Received:
    0
    Thanks for confirming that it is doable.
    I tweaked my code a bit.
    Maybe that will help.
     

Share This Page