The tax deductibility of advertising costs depends on whether the expenditure serves to achieve, secure and maintain taxable income, and on whether the company can demonstrate this. It is precisely this demonstration that tends to be the weak point. For online campaigns, an invoice supplemented with an output from the advertising system documenting what was promoted and over what period is usually sufficient. Items on the borderline between advertising and hospitality are more problematic: catering, gifts for clients, company events, or items with no company branding on them. Hospitality is not a tax-deductible expense, while promotional items meeting the statutory conditions generally are. Sponsorship, collaboration with influencers, and barter arrangements are assessed in the same way, and these must be backed by a contract and evidence of mutual performance. Discuss the boundary in your specific case with a tax advisor, since interpretation varies during inspections.
See also: Reverse-charge VAT on advertising from abroad, Company marketing budget, Contract with a marketing agency.