Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The integration of the LivematchPro tracker is a very simple process which can be achieved in 3 basic steps.

Step 1:

...

Tracker placement

The basic test which will show the visualization on your website can be done using our test Tracker. This scenario doesn't require any domain validation or agreement. You can place the visualization wherever you would like to.
To test the visualization you just need to place two pieces of scripts on your website:
 

  1. Tracker generator:
    Include the JavaScript code on your page once, ideally right before closing <body> tag.

    Code Block
    languagexml
    titleTracker generator
    <script rel="script" src="https://live.statscore.com/livescorepro/generator"></script>



  2. Tracker placeholder: 
    Place the code for your Tracker wherever you want the Tracker to appear on your page. 

    Code Block
    languagexml
    titleTracker placeholder
    <section id="Tracker-1" class="STATSCORE__Tracker" data-event="1653325" data-lang="en" data-config="169" data-zone="" data-use-mapped-id="0"></section>



  • id - it's the HTML element identifier. In case where few trackers will be visible on the same page, each id should have different value e.g. "tracker-2", "tracker-3" etc.
  • class - tracker element should always contain "STATSCORE__Tracker" class
  • data-event - this value should include STATSCORE event ID or CUSTOMER event ID.
    Please note: To force the script to use CUSTOMER event ID flag "use-mapped-id" should have value = 1.
  • data-lang - sets language for tracker
  • data-config - configuration id, different for each customer
  • data-zone - sets time-zone for tracker. If empty local time-zome will be detected automatically.
  • use-mapped-id - switch tracker to use STATSCORE or CUSTOMER event id in data-event parameter to display visualisation. 
    Possible values:
    "0" - in this case data-config parameter should store STATSCORE event ID to display widget.
    "1" - in this case data-config parameter should store CUSTOMER event ID to display widget and CUSTOMER event ID should be mapped with STATSCORE event ID in STATSCORE system.

Please note:
The test tracker has the same parameters as the real one, so you can change parameters like: lang and timezone to see how you can adjust the Tracker to your website. 
Colours, fonts and other styles in the production Tracker can be adjusted at the deployment stage after agreement has been reached.

Step 2: Pairing events with STATSCORE

Customers are being integrated by pairing events identifiers (ID's). STATSCORE is responsible for the automatic pairing process that should cover the major of the mapping process. The only requirement for the customer is to provide the list of teams and events in JSON format as below:

teams list - JSON

...

[{
"sport_id": 1,
"sport_name": "basketball",
"team_id": 222,
"team_name": "FC Barcelona",
"gender": "male", 
"country_id": 123,
"country_name": "Spain"

},

{

"sport_id": 2,
"sport_name": "volleyball",
"team_id": 223,
"team_name": "Manchester United",
"gender": "male",
"country_id": 321, 
"country_name": "England"

}]

Please note:
The attributes listed below are optional and should be sent only if available:
* gender
* country_id
* country_name

events list - JSON

...

[{
"event_id": 6726394,
"home_team_name": "Albirex Niigata FC",

"away_team_name": "Tampines Rovers FC",
"start_date_utc": "2015-09-10 11:30:00",
"home_team_id": 34081,
"away_team_id": 3043,
"sport_id": 1234,

"sport_name": "basketball",
"competition_name": "S-league",
"competition_id": 2345,
"country_name": "Singapore",
"country_id": 3456,
"provider_name": "betradar",
"provider_event_id": 123456789 
},

{

"event_id": 6726394,
"home_team_name": "Albirex Niigata FC",

"away_team_name": "Tampines Rovers FC",
"start_date_utc": "2015-09-10 11:30:00",
"home_team_id": 34081,
"away_team_id": 3043,
"sport_id": 1234,

"sport_name": "basketball",
"competition_name": "S-league",
"competition_id": 2345,
"country_name": "Singapore",
"country_id": 3456,
"provider_name": "betradar",
"provider_event_id": 123456789

}]

Please note:
The attributes listed below are optional and should be sent only if available:
* competition_id
* country
* country_id
* provider - this will help in automatic mapping (it could be "betradar" / "betconstruct" / "sporting-solutions" etc.)
* provider_event_id - this will help in automatic mapping

The list of JSON events should be ordered by start_date that is ascending. It should start from the current time and date and include also "live" events that have already started.
The list of JSON events should be limited to prevent server overload when customers have got thousands of events in the feed. This can be achieved by few features listed below (marked in red is prefered):

  • very important feature is the filter based on TIMESTAMP e.g. timestamp="1490959672" - then we can filter only the customer events which were created or changed after provided timestamp value.
    This feature allows to ensure your events will be mapped automatically up to 1 minute after you add this event to your feed.
  • filter by dates (date_from e.g. "date_from="2015-09-10 11:30:00", date_to e.g. date_to="2015-09-11 11:30:00").
    The mapping system goes past the dates and will include the following 6 months. 
    This feature allows to ensure your events will be mapped automatically up to 190 minutes after you add this event to your feed.
  • filter by sport_id separated by comma f.e. sport_id="1,3,5,7", would be good additional feature.
Please note:

...

the maximum size of the feed should not be greater than 2 MB, if there is more data it should be paginated.

...

Details about pairing events are described in this document: Pairing (mapping) events with STATSCORE

Step 3: Tracker configuration

If the test step is successful we are ready to place the production Tracker configured according to your needs.
In the production Tracker you need to set two basic parameters:

  1. data-config
    This value is given by STATSCORE to customers. There is a possibility to have more than one configuration for a customer (for example two different trackers or parts of the tracker on one website). By default, STATSCORE prepares one configuration for each customer (however more configurations can be ordered).
    On our demo website you can check different configurations (Select template): https://demo-livematchpro.statscore.com
     
  2. data-event
    STATSCORE'sunique identifier for an event (match). It should be a numeric value.

    All event identifiers are provided by STATSCORE in the API method named booked-events.
    Example: https://api.statscore.com/v2/booked-events?product=livescorepro&client_id=2&mapped_status=mapped
    In this method a customer can find his own event ID (client_event_id attribute). Then he can look for the STATSCORE event ID (id attribute) corresponding to the same event.

    booked-events - JSON

    [{

    "id": 123456, // this is STATSCORE event id (numeric)

    "client_event_id": "123456789", // this is your event ID (string)

    ...

    },

    {


    "id": 567890, // this is STATSCORE event id (numeric)

    "client_event_id": "qweoy28qry8r7yq83", // this is your event ID (string)

    ...

    }]


    To get the right list of booked events the customer needs to call this method with the proper value of CLIENT_ID provided by STATSCORE.
    There is also more information provided about the events which could be useful for the customer.

...