So close, but yet so far. Heart of Midlothian’s 2-1 defeat away to Rangers on Sunday offered hope and frustration in equal measure for the away supporters, who came within minutes of celebrating a famous victory in Glasgow’s south side. It had been nine years since Hearts had recorded a league win at Ibrox, and that unwanted record was stretched a little further in dramatic fashion.

It had all been going so well. Lawrence Shankland’s fifth-minute header handed Hearts the advantage early on in Govan, and Rangers were not at their best. The visitors were getting the little slices of luck that are required to gain three points at these sorts of venues – Shankland’s goal-line clearance from a first-half corner and James Tavernier’s missed penalty spring to mind – as the home fans grew more and more frustrated.

Rangers were struggling to fashion clear-cut chances but they were inevitably cranking up the pressure as the game wore on. They were offered something of a reprieve when referee John Beaton was called to the pitchside monitor following a corner kick to the hosts, deciding to award a penalty after spotting some shirt-pulling in the box by Peter Haring. Danilo’s match-winning goal a few minutes later, a close-range header from a Tavernier cross, had a degree of inevitability about it.

It was undoubtedly a painful moment for players and fans alike, and eerily reminiscent of the 2-2 draw in the Edinburgh derby when Hearts let a two-goal lead slip in less than two minutes. On that occasion, Steven Naismith’s in-game decisions were criticised but was it the same story at Ibrox? Let’s take a look.

READ MORE: Alex Cochrane Rangers Q&A: Game-plan, blocking and a huge test midweek

First half

Defence

Naismith changed the shape to a 5-3-2 for this fixture, with Beni Baningime sitting at the base of midfield and Jorge Grant and Calem Nieuwenhof slightly further ahead either side of him. Odel Offiah and Alex Cochrane occupied the wing-back positions, and Kenneth Vargas and Lawrence Shankland played up top. The back three was made up of Kye Rowles, Frankie Kent and Toby Sibbick.

It was clear that Naismith had opted for a relatively cautious approach – certainly when compared to the 4-1 loss at home to Celtic the previous week – and the former Scotland internationalist was keen to flood the central areas to ensure Rangers would struggle to attack through the middle. Nieuwenhof and Grant would have to drop deep and wide to mark the Rangers full-backs and prevent overloads out wide, but the team’s defensive shape should prove difficult to breach.

Take a look at Hearts’ pressing map from the first half below. Note how most of it is taking place outside the box and wide of the centre where three players – the wing-back, wide centre-half and wide central midfielder – can put real pressure on their opponents. A combination of Baningime in the No.6 position and the additional centre-back has essentially made the middle a no-go area for Rangers’ attackers.

The end result was that Rangers mustered very few shots from open play during the first half – just five, in fact, with a combined xG of 0.38. Almost all of the home side’s first-half xG (1.83) came from Dessers’ shot that was cleared off the line by Shankland (0.53) and Tavernier’s missed penalty (0.78). So long as Hearts could keep it tight at set-pieces and avoid any more individual errors, they had an excellent chance of continuing to frustrate their opponents. The plan was working.

READ MORE: Rangers loss will sting but Naismith has given Hearts fans something to believe in

Attack

It looked as though the main problem would be fashioning chances at the other end, with Vargas and Shankland likely feeding off scraps. The only way to prevent this was for Hearts to commit men forward in numbers when the opportunity arose to provide support, and that’s exactly what they did from an early throw-in down the right. The ball was eventually worked to Cochrane on the left, who did well to create space by cutting inside Tavernier before lofting a high cross towards the back post. Shankland had the height advantage against Ridvan Yilmaz and put it to good use as he steered the ball home to and Hearts the lead.

Scoring goals was always going to be the biggest challenge facing Hearts in such a set-up, and now they had one. But Hearts weren’t content to sit on their laurels. Rangers were always going to dominate possession but in the spells where Hearts had the ball, Naismith’s men weren’t afraid to get forward when they could. Look at this chance, for instance, that could have resulted in a carbon copy of Shankland’s opener.

Cochrane receives the ball on the left with Todd Cantwell bearing down on him. There’s acres of space down the left wing and as Cochrane receives the ball, he adjusts his body to look like he’s going to attack that space. Shankland, however, knows what’s about to happen and makes a beeline for the back post.

Cochrane cuts inside past Cantwell and has time and space to make his next pass. Similar to the goal, he decides to chip a ball towards the back post and hope that Shankland can once again beat Yilmaz in the air. The striker should be winning that duel, so it’s a ploy that makes sense.

Cochrane’s cross doesn’t have quite enough on it, and Yilmaz is able to intercept without Shankland breathing down his neck. The gambit doesn’t succeed on this occasion but as we’d already seen, Shankland could easily score if the ball in was slightly better. It only works if the other defenders are preoccupied, though – look how many bodies Hearts have in the box. Five players are in there, and another two are on the edge of the area. They committed men forward and weren’t far away from doubling their lead. But the second half would be an altogether different story.

READ MORE: Steven Naismith Rangers Q&A: Penalty decision, blocking in box and positives

Second half

Defence

The shape changed in the second half to a 5-4-1 as Naismith sacrificed defensive solidity through the middle so that Hearts could go man-for-man out wide. Rangers had peppered the Hearts box with crosses in the first half with little success, but the management team clearly felt that a reshuffle was required to negate this threat. Take a look at the pressing map below for an idea of how that changed the team’s defensive shape.

As we can see, a lot of the pressing is taking place further out wide than in the first half, and the overall shape is deeper too. This was partly down to the fact that the new formation hampered Hearts’ ability to play out – more on that shortly – and the absence of a No.6 has meant that the centre-backs have had to get more involved.

Rangers were still struggling, though. Up until the penalty, they had 13 shots from open play with a combined xG of 0.67. Opportunities for Nico Raskin (0.1) and Sam Lammers (0.18) were the pick of the bunch, with most shots having an xG of around 0.04. This tells us for all that Rangers bossed possession and had pot-shots at goal, very few seriously troubled Zander Clark. Phillipe Clement’s side had 28 shots on total throughout the match but only four were on target.

One of those, of course, was Tavernier’s penalty. Haring’s decision to tug Connor Goldson’s jersey was a rash one for a player of his experience, and Hearts could have few complaints when Beaton then pointed to the spot. The winner, too, arrived via an uncharacteristic error that Naismith could not have legislated for. Kent, usually so reliable in the air, really should have done better and cleared Tavernier’s cross but instead Danilo evaded the Englishman to nod the ball home and compound Hearts’ misery.

All in all, Hearts’ defensive strategy largely kept Rangers at bay in this match in both halves and could be considered effective. Individual errors proved costly, but the overall idea was sound. But can the same be said of the attack?

READ MORE: Rangers 2 Hearts 1 | Instant analysis: Caution, formation and in-game decisions

Attack

Chances were few and far between for Hearts in the first half – such is life as the away team at Ibrox – but on the rare occasions they arose Naismith’s men at least offered some sort of threat, even if the attack didn’t always result in an attempt on goal. Cochrane, Grant, Nieuwenhof and Offiah (and then Sibbick once Offiah was subbed off towards the end of the first half) were getting forward to support Shankland and Vargas, and there was a clear plan of how to build up. Look at the two pass maps below – the one on the left is from the first half, and the one on the right is from the second.

The first thing that jumps out is that Hearts are making far, far more passes in the first half. The second is that in the second half, there is a huge gaping hole where Baningime used to be. Hearts tended to play out in a V shape in the first half – starting centrally but advancing the ball forward with short passes that get further and further wide – but in order for this to work, a No.6 is required to provide an alternative option in the middle, thus occupying another Rangers player. Baningime did so ably in the first half but after the switch to a 5-4-1, there was no one there to occupy that void. All of a sudden, Hearts were struggling to get forward at all.

It was asking for trouble. Hearts were unable to even break forward on the counter-attack as the players found themselves besieged in their own half. They offered absolutely no threat going forward – Hearts mustered a single shot in the second half, a 94th-minute Haring header from a throw-in after Rangers had gone 2-1 up – and the team’s shape meant that they couldn’t retain possession either.

Hearts invited pressure onto themselves and so the end result, however cruel, should have come as little surprise. If you sit off the Old Firm and let them completely dominate the ball, it is only ever a matter of time before they find a way. On Sunday, Rangers left it late - but Hearts' inabiltity to keep the ball or hurt the opposition in the second half meant it was always likely to arrive.