Up to March 2018 RCM provisions are deferred. However your transaction happened before October 13, 2017 so you are liable for RCM if payment was than 5000.
Payment was made to agent and not to advertiser, so rate of service provider will be applicable.
In your case you need to pay tax at 18% rate on amount paid. 5% is applicable for print media but you have taken supply from agent and not directly.