We hear the purchase agreement has been signed and the pair are now marching towards a close at the end of this month. The rationale behind the deal is clear: when brands buy ad placements on Gannett properties, it could use BLiNQ to also sell them ads on social sites and collect a solid margin.

Gannett is looking to BLiNQ, which has built up a profitable Facebook ads API business, to become G’s equivalent of the Washington Post Company’s SocialCode, its social media marketing and analytics agency (which picked up 15 Digg engineers in May). Gannett and BLiNQ, TechCrunch understands, have already been working together for about a year on ad campaigns for advertising clients, primarily via those brands’ agencies. This will bring more of that expertise in house.

Digital was one of the bright spots for Gannett in its Q2 earnings, reported in the middle of July. With overall revenues of $1.3 billion down 2% on print advertising pressures, in its publishing segment, digital revenues were up by 29.3%; in its U.S. Community Publishing division they were up 33%; at USA Today they were up by 37%; and at the company’s Newsquest UK division they were up by 10%.

BLiNQ has only taken in about $3 million in funding, none from VCs, since launching in 2008. It was profitable in its Facebook marketing business from early on, and so it hasn’t needed to seek outside investment. More recently, it has been expanding into marketing on LinkedIn and Twitter, as well as Facebook’s mobile advertising efforts.

Among Gannett’s assets are digital marketing agency PointRoll and online circular company ShopLocal. You can see where a BLiNQ Media acquisition could position it very well to offer social ad buying services and tools to its advertiser and local business clients.

TechCrunch understands that in addition to David Nicol Williams, the co-founder and CEO of BLiNQ, Gannett was also interested in startup’s engineering team, led by CTO, Luis Caballero, who had also built up the engineering team at Vitrue . (Both companies are based in Atlanta, Georgia, which it turns out is something of a hotbed for social media marketing. Who knew?) TechCrunch understands that like Vitrue, Blinq has some IP that it is patenting. Blinq’s is centered around media optimization algorithms.

There is still “tons of innovation” that Blinq has left to roll out, we understand, so this could be the start of something interesting. With big media properties and advertising clients to test its products, it could crack the social code before Social Code, and help Gannett stay profitable as paper print media ends up in the wood chipper.