This study focuses on the problems of insufficient or excessive depth of pile foundation embedding and excessive pile displacement in pile foundation construction. By introducing global positioning system (GPS) technology, the study focuses on solving practical problems in pile foundation construction, optimizing pile foundation construction methods, and designing an optimization plan based on verified GPS technology in pile foundation construction. This plan includes precise guidance for pile foundation layout using GPS technology, accurate determination of effective pile length, and optimization of elevation measurement using GPS technology. To verify the effectiveness of the scheme, this study conducted empirical application in the pile foundation construction project of Building 4 in a certain residential area. The research results show that by combining the estimation of effective pile length with pre drilled pile planting method, the effective pile length can be accurately determined in most cases, and the error is controlled within a reasonable range. Compared with total stations, GPS technology has shown higher efficiency in determining pile foundation points and pile top elevations, and can significantly save costs. In addition, GPS technology can timely detect and correct problems during pile height measurement, ensuring the stability of construction quality.