The retailer plans to strengthen its higher-margin advertising division through a deal to acquire the CTV tech platform.