Hi Taysir
I can understand why you would want to do this and this is a perfectly acceptable way of doing it. However, I'm not sure why you would want to redirect it to another page. Why not just put all the information required on that page www.example.com/marketingcampaign?
There may (depending on who you listen to - I'm with Rand) up to 15% loss of link juice passing through a 301 redirect.
Also by publicising the 'vanity URL' it may well be indexed by Google but then de-indexed in favour of www.example.com/resources/primary-keyword-2018. because of the 301 redirect. When people searched for that page it wouldn't exist!
Intentionally setting up a URL that 301s is just bad practice and you risk Google not respecting it and listing both URLs anyway - so any ranking could go out of the window.
So in conclusion - fine having the 'vanity URL' (as you call it - it's a bit of an old-fashioned expression - any URL these days could be considered a 'vanity URL' - it was in the days when URLs had long strings of numbers and non-relevenat characters) but don't bother 301 redirecting. Use that single URL to provide all the information you need. You will be able to see it in Google analytics along with all of the source data.
(If you do decide to redirect - I wouldn't - do it in the htaccess file as it will all be seamless. Don't do it by java on the 'vanity URL' page. )
You could just use a preferred landing page and use UTM parameters to track in Analytics if you knew which source it was coming from.
https://support.google.com/analytics/answer/1033867?hl=en
Regards Nigel