I weep for humanity.
There is nothing inherent to ads that makes it universally something to avoid. Different people have different priorities for their ideal engineering job (num of users reached, power within the team, liking the product, liking the actual technical work, etc). I know people who loved working in ads: some of them didn't care a ton about the product they worked on, but loved the challenge of their technical work, and some who truly found the world of ads itself to be interesting. This set of priorities isn't necessarily something you'll realize immediately out of school; I was happy for a while with the technical challenge of the work I was doing in ads, but after a while I realized that my personal preference prioritized the actual product I was shipping higher than I thought, so I switched to something I was more excited about.
Don't listen to anyone stupid enough to tell you that there's any universal rule about jobs in ads being crappy (much less a "dead end"; I couldn't be happier where I am at this point and spending a couple of years working in the area of ads didn't hurt me at all). Keep in mind what your priorities are for your job (they're different for everyone) and do research on what a given role would entail (something that even good CS programs don't really prepare you for: I had to discover my aversion to front-end work the hard way).
Also, be aware that this can change in a few years. Some people consider working for Monsanto a "dead end", because not many other companies would want to hire a person like that afterwards.
Is this even true? I know it's the kind of thing that's hard to explicitly source, but I have a hard time believing that many companies (let alone most) would blacklist someone for working for Monsanto. I feel like the actual reason to avoid Monsanto would be if it's incompatible with your personal morality, not for some imagined fear of widespread reprisal.
For a facile example, I have a friend who got into environmental law and was very aware that she could either make peanuts defending the environment (at a non-profit) or make bank helping companies destroy it (she has chosen the former so far). If she suddenly had to deal with huge medical costs for a sick kid or something? One would have to be a complete asshole to judge her sight unseen for having a certain company on her resume.
By all means, if it's a good company I would highly suggest taking the job. A job at Facebook or Google for a year working as an ad engineer is still going to be a much better experience than most 'enterprise java' positions at a non-tech company.
I get contacted by recruiters every week, so I find any talk about a shortage of jobs in this field to be laughable.