Understanding Euro 2021 Stats to Help with Betting

If you are a football gambler, there are generally two different ways in which you can approach making your selections in this year European Championship (for more tips read this – Euro 2021 betting tips). The first is to look at recent form, league positions and choose who is going to win the game based on those things.

TOP 1 Football Betting Site

SugarHouse_online_log

Rating

9.17

Bonus

250 $

250 $

18+ BeGambleAware T&Cs apply

Try it now!

18+ BeGambleAware T&Cs apply

The second would be to look at stats, and perhaps use these to place different types of bets, not just looking at the winner but also looking at the number of goals that may be scored and the time of those. This also extends further, down to looking at corners, bookings and more, you can even look at each individual referee in the bigger leagues, to check out their card stats.

Understanding these stats at a simple level can not only broaden the type of bets you could place, but it will also make you more profitable in the long run.

People are asking these questions

⚽ What football stats should you look for when betting?

Punters should look to these stats when they are working out who to bet on – goals, clean sheets, corners, card bookings.

⚽ What is the easiest football bet to win?

Easiest football bet to win and understand is the money line bet, when you are betting who will win the match.

⚽ What time are most goals scored?

Most football goals scored (75% of the time) in the first and last 5 minutes of each half.

⚽ Which referee gives the most cards?

Mike Dean is the strictest referee, according to the Premier League results, he gives 1.93 yellow cards per game.

⚽ Is over 1.5 goals a good bet?

❌ Pre-match over 1.5 goals is not a good bet, because most of the time you will get very small odds. But when the game begins you can find some good value, because once the game begins each minute without a goal raises the odds.

{
“@context”: “https://schema.org”,
“@type”: “FAQPage”,
“mainEntity”: [
{
“@type”: “Question”,
“name”: “⚽ What football stats should you look for when betting?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Punters should look to these stats when they are working out who to bet on – goals, clean sheets, corners, card bookings.”
}
}, {
“@type”: “Question”,
“name”: “⚽ What is the easiest football bet to win?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Easiest football bet to win and understand is the money line bet, when you are betting who will win the match.”
}
}, {
“@type”: “Question”,
“name”: “⚽ What time are most goals scored?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Most football goals scored (75% of the time) in the first and last 5 minutes of each half.”
}
}, {
“@type”: “Question”,
“name”: “⚽ Which referee gives the most cards?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Mike Dean is the strictest referee, according to the Premier League results, he gives 1.93 yellow cards per game.”
}
}, {
“@type”: “Question”,
“name”: “⚽ Is over 1.5 goals a good bet?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “❌ Pre-match over 1.5 goals is not a good bet, because most of the time you will get very small odds. But when the game begins you can find some good value, because once the game begins each minute without a goal raises the odds.”
}
} ]
}

Of course, stats are based on what has happened in the past and is not always guaranteed to show the right trends for the future, but many teams play in the same style every game, leading to similar outcomes.

european championship euro 2021 results Match Up Teams Based on Stats

A football game consists of two teams, and to get the best from your stats, as well as knowing which way to go with your bets, you must match up two teams who are the same. This doesn’t mean they have the same ability, but it does mean they either both score a lot, or not so much, or both get lots of corners or take lots of bookings.

Things can become a little complicated when you are looking at teams who do opposites as you are then trying to work out which team will be able to enforce their style on the game. It doesn’t really matter what stat you are looking at here, just get two teams that are pointing in the right direction.

This could be goals, clean sheets, corners, or bookings, combined with a referee that has the same stats behind him. This is what the stats gamblers look for when they are working out who to bet on.

For example:

Two teams play each other, one team is averaging 2.7 goals in their games, the other is averaging 3.00 goals in their games. Both of these are above the 2.5 goals line that bookmakers offer, pointing towards a bet on that.

The opposite, where both teams are under 2.5 goals, would point to a bet being on the under 2.5 line that is on offer.

Corners are usually offered as either over/under betting lines or as blocks, where you will have three or four options to choose from. The latter of these is harder to use, so try and stick with the corner over/under line and do exactly the same as the above example for goals.

european championship euro 2021 results The Timing of Goals

One stat that some people don’t think to look at is the time that goals are scored on average. It is important to note here that the best way to look at this is when you have a lot of data, if you are only looking over a few games then a clean sheet counts for 90 minutes, which will make a big difference to the stat line.

The way to approach using this stat is to bet on goals or no goals in the first half, depending on what the stats say. The safest option with this is to bet on goals to happen for the teams that have been able to do this because this will not look artificially good because of clean sheets.

Let’s say you have two teams together who on average score their first goal of the game somewhere in the first 40 minutes. This is prime for bets on goals in the first half. It may be over 1.5 first-half goals, or maybe both teams to score in the first half.

These bets have far bigger odds than standard over 1.5 goals betting or regular both teams to score markets, as they cover the entire game but here you are just focusing on the first half. With the bigger odds on offer you can take a chance here and try to land something bigger.

Yes, the chances of both teams to score may look very likely, but that will lower the odds and those who don’t dive deeper into their stats will go with that bet and the lower odds. More knowledge and a deeper look could uncover the both teams to score in the first half bet that pays better odds, and only those who look for this will find it and take the profit.

european championship euro 2021 results Thinking About a Referee When Betting on Cards

Cards betting is another way of using stats, though probably the toughest to get right because it all relies on challenges being made and fouls being committed, which is hard to get right. However, it is worth mentioning here because there is an element that many people often miss, and in many respects, it is the most important element, the referee.

Just as you look at players on a team as potential people to receive cards, the referee’s all have stats associated with them, showing how likely they will give cards, or if they are lenient. The good news for those who bet on cards is that if you bet in the bigger leagues, these referee stats are freely available online, just like other football stats are.

When you are going for cards, look to combine all three elements to give you a betting opportunity, the two teams and the referee who is in charge.

A lenient official could be enough to keep the card count low, regardless of the fouls committed by the players and how their history looks. Make sure you don’t sacrifice learning up on the official who is taking charge of a game, these are announced in advance and stats can be found on the big leagues.

european championship euro 2021 results Euro 2021 results

No events on selected day

More Events

jQuery(document).ready(function ($) {
class DatePicker {
datepickerInstance = null
showMoreText=””
showLessText=””
constructor(classInstance = this) {
this.showMoreText=”More Events”;
this.showLessText=”Less Events”;
this.datepickerInstance = flatpickr(‘.flatpickr-sport-data’, {
enableTime: false,
//minDate: //,
//maxDate: //,
defaultDate: new Date(),
onReady: function(selectedDate, time, calendar) {
let parent = $(calendar.input).closest(‘.score-collection’);
const type = parent.find(‘.type’).val();
if (type === ‘results’) {
calendar.set(‘maxDate’, new Date());
classInstance.toggleDateArrows(time, parent);
}
},
onChange: function(item, val, calendar) {
let parent = $(calendar.input).closest(‘.score-collection’);
const type = parent.find(‘.type’).val();
let startDate = new Date(item);
startDate.setHours(0,0,0,0);
let endDate = new Date(item);
endDate.setHours(23,59,59,999);
parent.find(‘.no-events’).hide();
parent.find(‘.expand’).find(‘.fas’).removeClass(‘fa-chevron-up’).addClass(‘fa-chevron-down’);
parent.find(‘.expand’).removeClass(‘expanded’).find(‘.button-label’).html(classInstance.showMoreText);
if (type === ‘results’) {
classInstance.toggleDateArrows(val, parent);
}

if (type == ‘schedule’) {
// Unslick before changing date.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
if ($(this).hasClass(‘slick-initialized’)) {
$(this).slick(‘unslick’);
}
});
}

classInstance.call(parent, startDate / 1000, endDate / 1000);

// alert(‘FINAL’);
}
});
$(‘.date-arrow’).off().on(‘click’, function() {
const parent = $(this).closest(‘.score-collection’);
if (parent.hasClass(‘loading-data’)) return;
const action = $(this).data(‘action’) === ‘previous’ ? -1 : 1;
const datepicker = parent.find(‘.flatpickr-sport-data’)[0]._flatpickr;
const newDate = new Date(datepicker.selectedDates[0]).fp_incr(action);
datepicker.setDate(newDate, true);
});
$(‘.input-button-datepicker’).off().on(‘click’, function() {
$(this).closest(‘.score-collection’).find(‘.flatpickr-sport-data’)[0]._flatpickr.open();
});
$(‘.expand’).off().on(‘click’, function() {
$(this).toggleClass(‘expanded’)
$(this).hasClass(‘expanded’) ? $(this).find(‘.button-label’).html(classInstance.showLessText) : $(this).find(‘.button-label’).html(classInstance.showMoreText);
$(this).find(‘.fas’).toggleClass(‘fa-chevron-down’);
$(this).find(‘.fas’).toggleClass(‘fa-chevron-up’);
$(this).closest(‘.score-collection’).find(‘.collapsible’).each(function(key, item) {
$(item).toggleClass(‘expanded’)
$(item).toggle();
})
});
// Initial call
$(‘.flatpickr-sport-data:not(.initialized)’).each(function () {
let parent = $(this).closest(‘.score-collection’)
let startDate = new Date();
startDate.setHours(0,0,0,0);
let endDate = new Date();
endDate.setHours(23,59,59,999);
$(this).addClass(‘initialized’);
classInstance.call(parent, startDate / 1000, endDate / 1000, classInstance)
});
}
toggleDateArrows(time, parent) {
let now = new Date();
now.setHours(0,0,0,0);
let parsedNow = Math.round(now.getTime() / 1000);
let dateParsed = new Date(time);
dateParsed.setHours(0,0,0,0);
let date = Math.round(dateParsed.getTime() / 1000);
if (date === parsedNow) {
parent.find(‘.date-next’).css(‘visibility’, ‘hidden’);
} else {
parent.find(‘.date-next’).css(‘visibility’, ‘visible’);
}
}
getEarliestEventDate(parent, startDate, classInstance) {
let instance = classInstance.datepickerInstance;
if (classInstance.datepickerInstance.length > 1) {
instance = classInstance.datepickerInstance.find(function (instance) {
return $(instance.input).closest(‘.score-collection’)[0] === parent[0];
})
}
let input = $(instance.input);
let context = input[‘context’]._flatpickr;
if (input.hasClass(‘reinitialized’)) return;
input.addClass(‘reinitialized’);
input.attr(‘disabled’, ‘disabled’);
input.closest(‘.loader-input-block’).find(‘.loader-input’).show();
parent.addClass(‘loading-data’);
$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘get_earliest_event_date’,
league: parent.find(‘.leagueName’).val(),
season: parent.find(‘.seasonName’).val(),
limit: parent.find(‘.limit’).val(),
order: parent.find(‘.order’).val(),
type: parent.find(‘.type’).val(),
team1: parent.find(‘.team1’).val(),
team2: parent.find(‘.team2’).val(),
startDate: startDate
}, success: function (response) {
if (response.data) {
// console.log(response.data);
context.setDate(new Date(response.data.date * 1000), true)
} else {
parent.find(‘.score-collection__content’).empty();
parent.find(‘.no-events’).show();
}
}, error: function () {
}, complete: function () {
input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
input.removeAttr(‘disabled’);
parent.removeClass(‘loading-data’);
}
})
}
getEventOdds(home_team, away_team, event_timestamp) {
let instance = classInstance.datepickerInstance;
if (classInstance.datepickerInstance.length > 1) {
instance = classInstance.datepickerInstance.find(function (instance) {
return $(instance.input).closest(‘.score-collection’)[0] === parent[0];
})
}
// let input = $(instance.input);
// let context = input[‘context’]._flatpickr;
// if (input.hasClass(‘reinitialized’)) return;
// input.addClass(‘reinitialized’);
// input.attr(‘disabled’, ‘disabled’);
// input.closest(‘.loader-input-block’).find(‘.loader-input’).show();
// parent.addClass(‘loading-data’);
$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘guru_sports_data_get_single_event_odds’,
home_team: home_team,
away_team: away_team,
event_timestamp: event_timestamp,
}, success: function (response) {
// if (response.data) {
// console.log(response.data);
// context.setDate(new Date(response.data.date * 1000), true)
// } else {
// parent.find(‘.score-collection__content’).empty();
// parent.find(‘.no-events’).show();
// }

}, error: function () {
}, complete: function () {
// input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
// input.removeAttr(‘disabled’);
// parent.removeClass(‘loading-data’);
}
})
}
renderResults(parent, response) {
let $collection = parent.find(‘.scaffold-div’).clone();
response.data.forEach(function (item, key) {
const data = JSON.parse(item.data);
let clonedItem = parent.find(‘.score-item.scaffold-results’).clone();
let modified = clonedItem[0]
$(modified).find(‘.score-item-home .title-name’).html(item.home_team);
$(modified).find(‘.score-item-away .title-name’).html(item.away_team);
$(modified).find(‘.score-item__content .home-team-name’).val(item.home_team);
$(modified).find(‘.score-item__content .away-team-name’).val(item.away_team);
const imageSlug = data.sport ? data.sport.slug : data.tournament.uniqueTournament.category.sport.slug;
const imageHomeUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.homeTeam.id + ‘.png’;
const imageAwayUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.awayTeam.id + ‘.png’;
$(modified).find(‘.score-item-home img’).attr(‘src’, imageHomeUrl);
$(modified).find(‘.score-item-away img’).attr(‘src’, imageAwayUrl);
if (item.type !== ‘finished’) {
const date = new Date(data.startTimestamp * 1000);
let minutes = date.getMinutes() === 0 ? ’00’ : date.getMinutes();
if (minutes < 10) {
minutes = '0' + date.getMinutes();
}
const hours = date.getHours() data.awayScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-home .home-score’).html(data.homeScore.current)
$(modified).find(‘.score-item-away’).removeClass(‘winner’).addClass(data.awayScore.current > data.homeScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-away .away-score’).html(data.awayScore.current)
}
let showItem = $(modified).removeClass(‘scaffold-results’);
showItem.show();
let singlePage = parent.hasClass(‘single-page’)
parent.find(‘.expand’).hide();
if (singlePage) {
if (key >= 4) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
}
} else {
if (key >= 6) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
}
}
$collection.append(showItem);
})
parent.find(‘.score-collection__content’).addClass(‘results’).html($collection.children());
}
renderSchedule(parent, response) {
// Unslick before rendering schedule.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
if ($(this).hasClass(‘slick-initialized’)) {
$(this).slick(‘unslick’);
}
});

let $collection = parent.find(‘.scaffold-div’).clone();
response.data.forEach(function (item, key) {
const data = JSON.parse(item.data);
let clonedItem = parent.find(‘.score-item.scaffold’).clone();
let modified = clonedItem[0]
$(modified).find(‘.score-item-home .title-name’).html(item.home_team);
$(modified).find(‘.score-item-away .title-name’).html(item.away_team);
$(modified).find(‘.score-item__content .home-team-name’).val(item.home_team);
$(modified).find(‘.score-item__content .away-team-name’).val(item.away_team);
$(modified).find(‘.score-item__content .event-timestamp’).val(item.date);

let league_name = parent.find(‘.leagueName’).val();

// Get Odds only if it’s Euro2020 schedule.
if (league_name == ‘European Championship’) {

$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘guru_sports_data_get_single_event_odds’,
home_team: item.home_team,
away_team: item.away_team,
event_timestamp: item.date,
}, success: function (response) {
if (response.data) {
if (response.data.odd_1.bookmaker_logo &&
response.data.odd_2.bookmaker_logo &&
response.data.odd_x.bookmaker_logo &&
response.data.odd_1.bookmaker_link &&
response.data.odd_2.bookmaker_link &&
response.data.odd_x.bookmaker_link) {
$(modified).find(‘.score-item__content .odd-home .line’).text(response.data.odd_1.line);
$(modified).find(‘.score-item__content .odd-home .text’).text(‘HOME’);
$(modified).find(‘.score-item__content .odd-home .bookmaker’).html(response.data.odd_1.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-home > a’).attr(‘href’, response.data.odd_1.bookmaker_link);
$(modified).find(‘.score-item__content .odd-home’).removeClass(‘hide’);

// Odd Away
$(modified).find(‘.score-item__content .odd-away .line’).text(response.data.odd_2.line);
$(modified).find(‘.score-item__content .odd-away .text’).text(‘AWAY’);
$(modified).find(‘.score-item__content .odd-away .bookmaker’).html(response.data.odd_2.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-away > a’).attr(‘href’, response.data.odd_2.bookmaker_link);
$(modified).find(‘.score-item__content .odd-away’).removeClass(‘hide’);

// Odd Draw
$(modified).find(‘.score-item__content .odd-draw .line’).text(response.data.odd_x.line);
$(modified).find(‘.score-item__content .odd-draw .text’).text(‘DRAW’);
$(modified).find(‘.score-item__content .odd-draw .bookmaker’).html(response.data.odd_x.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-draw > a’).attr(‘href’, response.data.odd_x.bookmaker_link);
$(modified).find(‘.score-item__content .odd-draw’).removeClass(‘hide’);
} else {
$(modified).find(‘.score-item__content .odd’).hide();
}

// console.log(response.data);
// context.setDate(new Date(response.data.date * 1000), true)
} else {
// parent.find(‘.score-collection__content’).empty();
// parent.find(‘.no-events’).show();
}
}, error: function () {
}, complete: function () {
// input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
// input.removeAttr(‘disabled’);
// parent.removeClass(‘loading-data’);
}
});
}

const imageSlug = data.sport ? data.sport.slug : data.tournament.uniqueTournament.category.sport.slug;
const imageHomeUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.homeTeam.id + ‘.png’;
const imageAwayUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.awayTeam.id + ‘.png’;
$(modified).find(‘.score-item-home img’).attr(‘src’, imageHomeUrl);
$(modified).find(‘.score-item-away img’).attr(‘src’, imageAwayUrl);
if (item.type !== ‘finished’) {
const date = new Date(data.startTimestamp * 1000);
let minutes = date.getMinutes() === 0 ? ’00’ : date.getMinutes();
if (minutes < 10) {
minutes = '0' + date.getMinutes();
}
const hours = date.getHours() data.awayScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-block .away-score’).html(data.awayScore.current)
.removeClass(‘winner’)
.addClass(data.awayScore.current > data.homeScore.current ? ‘winner’ : ”);
}
let showItem = $(modified).removeClass(‘scaffold’);
showItem.show();
if (key > 4) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
} else {
parent.find(‘.expand’).hide();
}
$collection.append(showItem);
})

parent.find(‘.score-collection__content’).html($collection.children());
}
updateDom(parent, response) {
const type = parent.find(‘.type’).val();
type === ‘results’ ? this.renderResults(parent, response) : this.renderSchedule(parent, response);
}

call(parent, startDate, endDate, classInstance = null) {
const context = this
if (! parent) return
parent.find(‘.score-collection__content’).css(‘opacity’, 0);
parent.find(‘.loader’).show();
parent.find(‘.expand’).hide();
parent.addClass(‘loading-data’);

$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘get_events’, // load function hooked to: “wp_ajax_*” action hook
league: parent.find(‘.leagueName’).val(),
season: parent.find(‘.seasonName’).val(),
limit: parent.find(‘.limit’).val(),
order: parent.find(‘.order’).val(),
type: parent.find(‘.type’).val(),
team1: parent.find(‘.team1’).val(),
team2: parent.find(‘.team2’).val(),
startDate: startDate,
endDate: endDate,
}, success: function (response) {
if (! response.data) {
if (classInstance) {
parent.find(‘.score-collection__content’).css(‘opacity’, 0);
return classInstance.getEarliestEventDate(parent, startDate, classInstance)
}
parent.find(‘.score-collection__content’).empty();
parent.find(‘.expand’).hide();
parent.find(‘.no-events’).show();
return;
}

context.updateDom(parent, response)
parent.find(‘.score-collection__content’).css(‘opacity’, 1);

if (parent.hasClass(‘schedule-type’)) {
// Initialize Slick JS only first time.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
// Slick if there is no slick list.
$(this).not(‘slick-initialized’).slick({
infinite: false,
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
nextArrow:
” +
” +
” +
” +
” +
” +
”,
prevArrow:
” +
” +
” +
” +
” +
” +
”,
});
});

// Move Slick JS to first item and refresh items.
if ($(‘.euro-2020-odds .score-collection__content.slick-initialized’).length) {
$(‘.euro-2020-odds .score-collection__content’).slick(‘slickGoTo’, 0);
$(‘.euro-2020-odds .score-collection__content’).slick(‘refresh’);
}

}
},
error: function () {},
complete: function () {
if (! classInstance) {
parent.find(‘.loader’).hide();
parent.find(‘.score-collection__content’).css(‘opacity’, 1);
}
parent.find(‘.loader’).hide();
parent.removeClass(‘loading-data’);
}
});
}
}
const datePicker = new DatePicker();
$(‘.score-collection p’).contents().unwrap().siblings(‘p’).remove();
})

european championship euro 2021 scheduleEuro 2021 schedule

No events on selected day

More Events

jQuery(document).ready(function ($) {
class DatePicker {
datepickerInstance = null
showMoreText=””
showLessText=””
constructor(classInstance = this) {
this.showMoreText=”More Events”;
this.showLessText=”Less Events”;
this.datepickerInstance = flatpickr(‘.flatpickr-sport-data’, {
enableTime: false,
//minDate: //,
//maxDate: //,
defaultDate: new Date(),
onReady: function(selectedDate, time, calendar) {
let parent = $(calendar.input).closest(‘.score-collection’);
const type = parent.find(‘.type’).val();
if (type === ‘results’) {
calendar.set(‘maxDate’, new Date());
classInstance.toggleDateArrows(time, parent);
}
},
onChange: function(item, val, calendar) {
let parent = $(calendar.input).closest(‘.score-collection’);
const type = parent.find(‘.type’).val();
let startDate = new Date(item);
startDate.setHours(0,0,0,0);
let endDate = new Date(item);
endDate.setHours(23,59,59,999);
parent.find(‘.no-events’).hide();
parent.find(‘.expand’).find(‘.fas’).removeClass(‘fa-chevron-up’).addClass(‘fa-chevron-down’);
parent.find(‘.expand’).removeClass(‘expanded’).find(‘.button-label’).html(classInstance.showMoreText);
if (type === ‘results’) {
classInstance.toggleDateArrows(val, parent);
}

if (type == ‘schedule’) {
// Unslick before changing date.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
if ($(this).hasClass(‘slick-initialized’)) {
$(this).slick(‘unslick’);
}
});
}

classInstance.call(parent, startDate / 1000, endDate / 1000);

// alert(‘FINAL’);
}
});
$(‘.date-arrow’).off().on(‘click’, function() {
const parent = $(this).closest(‘.score-collection’);
if (parent.hasClass(‘loading-data’)) return;
const action = $(this).data(‘action’) === ‘previous’ ? -1 : 1;
const datepicker = parent.find(‘.flatpickr-sport-data’)[0]._flatpickr;
const newDate = new Date(datepicker.selectedDates[0]).fp_incr(action);
datepicker.setDate(newDate, true);
});
$(‘.input-button-datepicker’).off().on(‘click’, function() {
$(this).closest(‘.score-collection’).find(‘.flatpickr-sport-data’)[0]._flatpickr.open();
});
$(‘.expand’).off().on(‘click’, function() {
$(this).toggleClass(‘expanded’)
$(this).hasClass(‘expanded’) ? $(this).find(‘.button-label’).html(classInstance.showLessText) : $(this).find(‘.button-label’).html(classInstance.showMoreText);
$(this).find(‘.fas’).toggleClass(‘fa-chevron-down’);
$(this).find(‘.fas’).toggleClass(‘fa-chevron-up’);
$(this).closest(‘.score-collection’).find(‘.collapsible’).each(function(key, item) {
$(item).toggleClass(‘expanded’)
$(item).toggle();
})
});
// Initial call
$(‘.flatpickr-sport-data:not(.initialized)’).each(function () {
let parent = $(this).closest(‘.score-collection’)
let startDate = new Date();
startDate.setHours(0,0,0,0);
let endDate = new Date();
endDate.setHours(23,59,59,999);
$(this).addClass(‘initialized’);
classInstance.call(parent, startDate / 1000, endDate / 1000, classInstance)
});
}
toggleDateArrows(time, parent) {
let now = new Date();
now.setHours(0,0,0,0);
let parsedNow = Math.round(now.getTime() / 1000);
let dateParsed = new Date(time);
dateParsed.setHours(0,0,0,0);
let date = Math.round(dateParsed.getTime() / 1000);
if (date === parsedNow) {
parent.find(‘.date-next’).css(‘visibility’, ‘hidden’);
} else {
parent.find(‘.date-next’).css(‘visibility’, ‘visible’);
}
}
getEarliestEventDate(parent, startDate, classInstance) {
let instance = classInstance.datepickerInstance;
if (classInstance.datepickerInstance.length > 1) {
instance = classInstance.datepickerInstance.find(function (instance) {
return $(instance.input).closest(‘.score-collection’)[0] === parent[0];
})
}
let input = $(instance.input);
let context = input[‘context’]._flatpickr;
if (input.hasClass(‘reinitialized’)) return;
input.addClass(‘reinitialized’);
input.attr(‘disabled’, ‘disabled’);
input.closest(‘.loader-input-block’).find(‘.loader-input’).show();
parent.addClass(‘loading-data’);
$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘get_earliest_event_date’,
league: parent.find(‘.leagueName’).val(),
season: parent.find(‘.seasonName’).val(),
limit: parent.find(‘.limit’).val(),
order: parent.find(‘.order’).val(),
type: parent.find(‘.type’).val(),
team1: parent.find(‘.team1’).val(),
team2: parent.find(‘.team2’).val(),
startDate: startDate
}, success: function (response) {
if (response.data) {
// console.log(response.data);
context.setDate(new Date(response.data.date * 1000), true)
} else {
parent.find(‘.score-collection__content’).empty();
parent.find(‘.no-events’).show();
}
}, error: function () {
}, complete: function () {
input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
input.removeAttr(‘disabled’);
parent.removeClass(‘loading-data’);
}
})
}
getEventOdds(home_team, away_team, event_timestamp) {
let instance = classInstance.datepickerInstance;
if (classInstance.datepickerInstance.length > 1) {
instance = classInstance.datepickerInstance.find(function (instance) {
return $(instance.input).closest(‘.score-collection’)[0] === parent[0];
})
}
// let input = $(instance.input);
// let context = input[‘context’]._flatpickr;
// if (input.hasClass(‘reinitialized’)) return;
// input.addClass(‘reinitialized’);
// input.attr(‘disabled’, ‘disabled’);
// input.closest(‘.loader-input-block’).find(‘.loader-input’).show();
// parent.addClass(‘loading-data’);
$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘guru_sports_data_get_single_event_odds’,
home_team: home_team,
away_team: away_team,
event_timestamp: event_timestamp,
}, success: function (response) {
// if (response.data) {
// console.log(response.data);
// context.setDate(new Date(response.data.date * 1000), true)
// } else {
// parent.find(‘.score-collection__content’).empty();
// parent.find(‘.no-events’).show();
// }

}, error: function () {
}, complete: function () {
// input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
// input.removeAttr(‘disabled’);
// parent.removeClass(‘loading-data’);
}
})
}
renderResults(parent, response) {
let $collection = parent.find(‘.scaffold-div’).clone();
response.data.forEach(function (item, key) {
const data = JSON.parse(item.data);
let clonedItem = parent.find(‘.score-item.scaffold-results’).clone();
let modified = clonedItem[0]
$(modified).find(‘.score-item-home .title-name’).html(item.home_team);
$(modified).find(‘.score-item-away .title-name’).html(item.away_team);
$(modified).find(‘.score-item__content .home-team-name’).val(item.home_team);
$(modified).find(‘.score-item__content .away-team-name’).val(item.away_team);
const imageSlug = data.sport ? data.sport.slug : data.tournament.uniqueTournament.category.sport.slug;
const imageHomeUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.homeTeam.id + ‘.png’;
const imageAwayUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.awayTeam.id + ‘.png’;
$(modified).find(‘.score-item-home img’).attr(‘src’, imageHomeUrl);
$(modified).find(‘.score-item-away img’).attr(‘src’, imageAwayUrl);
if (item.type !== ‘finished’) {
const date = new Date(data.startTimestamp * 1000);
let minutes = date.getMinutes() === 0 ? ’00’ : date.getMinutes();
if (minutes < 10) {
minutes = '0' + date.getMinutes();
}
const hours = date.getHours() data.awayScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-home .home-score’).html(data.homeScore.current)
$(modified).find(‘.score-item-away’).removeClass(‘winner’).addClass(data.awayScore.current > data.homeScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-away .away-score’).html(data.awayScore.current)
}
let showItem = $(modified).removeClass(‘scaffold-results’);
showItem.show();
let singlePage = parent.hasClass(‘single-page’)
parent.find(‘.expand’).hide();
if (singlePage) {
if (key >= 4) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
}
} else {
if (key >= 6) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
}
}
$collection.append(showItem);
})
parent.find(‘.score-collection__content’).addClass(‘results’).html($collection.children());
}
renderSchedule(parent, response) {
// Unslick before rendering schedule.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
if ($(this).hasClass(‘slick-initialized’)) {
$(this).slick(‘unslick’);
}
});

let $collection = parent.find(‘.scaffold-div’).clone();
response.data.forEach(function (item, key) {
const data = JSON.parse(item.data);
let clonedItem = parent.find(‘.score-item.scaffold’).clone();
let modified = clonedItem[0]
$(modified).find(‘.score-item-home .title-name’).html(item.home_team);
$(modified).find(‘.score-item-away .title-name’).html(item.away_team);
$(modified).find(‘.score-item__content .home-team-name’).val(item.home_team);
$(modified).find(‘.score-item__content .away-team-name’).val(item.away_team);
$(modified).find(‘.score-item__content .event-timestamp’).val(item.date);

let league_name = parent.find(‘.leagueName’).val();

// Get Odds only if it’s Euro2020 schedule.
if (league_name == ‘European Championship’) {

$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘guru_sports_data_get_single_event_odds’,
home_team: item.home_team,
away_team: item.away_team,
event_timestamp: item.date,
}, success: function (response) {
if (response.data) {
if (response.data.odd_1.bookmaker_logo &&
response.data.odd_2.bookmaker_logo &&
response.data.odd_x.bookmaker_logo &&
response.data.odd_1.bookmaker_link &&
response.data.odd_2.bookmaker_link &&
response.data.odd_x.bookmaker_link) {
$(modified).find(‘.score-item__content .odd-home .line’).text(response.data.odd_1.line);
$(modified).find(‘.score-item__content .odd-home .text’).text(‘HOME’);
$(modified).find(‘.score-item__content .odd-home .bookmaker’).html(response.data.odd_1.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-home > a’).attr(‘href’, response.data.odd_1.bookmaker_link);
$(modified).find(‘.score-item__content .odd-home’).removeClass(‘hide’);

// Odd Away
$(modified).find(‘.score-item__content .odd-away .line’).text(response.data.odd_2.line);
$(modified).find(‘.score-item__content .odd-away .text’).text(‘AWAY’);
$(modified).find(‘.score-item__content .odd-away .bookmaker’).html(response.data.odd_2.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-away > a’).attr(‘href’, response.data.odd_2.bookmaker_link);
$(modified).find(‘.score-item__content .odd-away’).removeClass(‘hide’);

// Odd Draw
$(modified).find(‘.score-item__content .odd-draw .line’).text(response.data.odd_x.line);
$(modified).find(‘.score-item__content .odd-draw .text’).text(‘DRAW’);
$(modified).find(‘.score-item__content .odd-draw .bookmaker’).html(response.data.odd_x.bookmaker_logo);
$(modified).find(‘.score-item__content .odd-draw > a’).attr(‘href’, response.data.odd_x.bookmaker_link);
$(modified).find(‘.score-item__content .odd-draw’).removeClass(‘hide’);
} else {
$(modified).find(‘.score-item__content .odd’).hide();
}

// console.log(response.data);
// context.setDate(new Date(response.data.date * 1000), true)
} else {
// parent.find(‘.score-collection__content’).empty();
// parent.find(‘.no-events’).show();
}
}, error: function () {
}, complete: function () {
// input.closest(‘.loader-input-block’).find(‘.loader-input’).hide();
// input.removeAttr(‘disabled’);
// parent.removeClass(‘loading-data’);
}
});
}

const imageSlug = data.sport ? data.sport.slug : data.tournament.uniqueTournament.category.sport.slug;
const imageHomeUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.homeTeam.id + ‘.png’;
const imageAwayUrl=”https://smartbettingguide.com/app/uploads/guru-sports-data/team-logos/” + data.awayTeam.id + ‘.png’;
$(modified).find(‘.score-item-home img’).attr(‘src’, imageHomeUrl);
$(modified).find(‘.score-item-away img’).attr(‘src’, imageAwayUrl);
if (item.type !== ‘finished’) {
const date = new Date(data.startTimestamp * 1000);
let minutes = date.getMinutes() === 0 ? ’00’ : date.getMinutes();
if (minutes < 10) {
minutes = '0' + date.getMinutes();
}
const hours = date.getHours() data.awayScore.current ? ‘winner’ : ”);
$(modified).find(‘.score-item-block .away-score’).html(data.awayScore.current)
.removeClass(‘winner’)
.addClass(data.awayScore.current > data.homeScore.current ? ‘winner’ : ”);
}
let showItem = $(modified).removeClass(‘scaffold’);
showItem.show();
if (key > 4) {
parent.find(‘.expand’).show();
showItem.addClass(‘collapsible’).hide();
} else {
parent.find(‘.expand’).hide();
}
$collection.append(showItem);
})

parent.find(‘.score-collection__content’).html($collection.children());
}
updateDom(parent, response) {
const type = parent.find(‘.type’).val();
type === ‘results’ ? this.renderResults(parent, response) : this.renderSchedule(parent, response);
}

call(parent, startDate, endDate, classInstance = null) {
const context = this
if (! parent) return
parent.find(‘.score-collection__content’).css(‘opacity’, 0);
parent.find(‘.loader’).show();
parent.find(‘.expand’).hide();
parent.addClass(‘loading-data’);

$.ajax({
type: ‘POST’,
url: ‘https://smartbettingguide.com/wp/wp-admin/admin-ajax.php’,
data: {
action: ‘get_events’, // load function hooked to: “wp_ajax_*” action hook
league: parent.find(‘.leagueName’).val(),
season: parent.find(‘.seasonName’).val(),
limit: parent.find(‘.limit’).val(),
order: parent.find(‘.order’).val(),
type: parent.find(‘.type’).val(),
team1: parent.find(‘.team1’).val(),
team2: parent.find(‘.team2’).val(),
startDate: startDate,
endDate: endDate,
}, success: function (response) {
if (! response.data) {
if (classInstance) {
parent.find(‘.score-collection__content’).css(‘opacity’, 0);
return classInstance.getEarliestEventDate(parent, startDate, classInstance)
}
parent.find(‘.score-collection__content’).empty();
parent.find(‘.expand’).hide();
parent.find(‘.no-events’).show();
return;
}

context.updateDom(parent, response)
parent.find(‘.score-collection__content’).css(‘opacity’, 1);

if (parent.hasClass(‘schedule-type’)) {
// Initialize Slick JS only first time.
$(‘.euro-2020-odds .score-collection__content’).each(function (index) {
// Slick if there is no slick list.
$(this).not(‘slick-initialized’).slick({
infinite: false,
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
nextArrow:
” +
” +
” +
” +
” +
” +
”,
prevArrow:
” +
” +
” +
” +
” +
” +
”,
});
});

// Move Slick JS to first item and refresh items.
if ($(‘.euro-2020-odds .score-collection__content.slick-initialized’).length) {
$(‘.euro-2020-odds .score-collection__content’).slick(‘slickGoTo’, 0);
$(‘.euro-2020-odds .score-collection__content’).slick(‘refresh’);
}

}
},
error: function () {},
complete: function () {
if (! classInstance) {
parent.find(‘.loader’).hide();
parent.find(‘.score-collection__content’).css(‘opacity’, 1);
}
parent.find(‘.loader’).hide();
parent.removeClass(‘loading-data’);
}
});
}
}
const datePicker = new DatePicker();
$(‘.score-collection p’).contents().unwrap().siblings(‘p’).remove();
})

The post Understanding Euro 2021 Stats to Help with Betting appeared first on SmartBettingGuide.com.