Residual gas plays a crucial role in the combustion process of spark ignited engines. It acts as a diluent and has a huge impact on pollutant emissions (NOx and CO emissions), engine efficiency and tendency to knock. Therefore, characterizing the residual gas fraction is an essential task for engine modelling and calibration purposes. Thus, an in-cylinder sampling technique was developed on a spark ignited VVT engine to measure residual gas fraction during the compression phase. Two gas sampling valves were flush mounted to the combustion chamber walls; they are located between the intake valves and between intake and exhaust valves respectively. Sampled gas was stocked in a sampling bag using a vacuum pump and measured with a standard gas analyzer. This paper describes in details the sampling technique and proposes a methodology allowing the evaluation of the residual gas fraction. For this purpose, five kinds of tests were undertaken. First, sampling to reach different bag volumes was achieved to study the measured signal provided by the analyzer. Then, a short sampling interval test throughout the compression phase was conducted using the first sampling valve to identify the temporal disparity in the chamber and determine the maximum permissible range for a stable measurement. Multiple samplings were then lead with different engine operating points using both sampling valves to identify spatial inhomogeneity and validate the range from the previous test. The study was completed by repeating samples which were aimed at assessing the system uncertainty and the engine repeatability. Based on the above tests and the methodology used, a reliable and adequate estimation of the residual fraction was provided.