Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Please don't post about US Politics. If you need to do this, try !politicaldiscussion@lemmy.world
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
view the rest of the comments
Sorry I'm responding to such an old question, but it seemed like there wasn't an answer.
So when you make an http request (which you do every time you download a podcast episode), the request includes your IP address as part of the headers; it's called "remote address," and it's a part of every http request that's made on the internet. In fact, it has to be, as this is how responses are directed back to your device.
Now, this isn't perfect, but there are code libraries that can take that IP and fetch your location from a GeoIP database. It won't get your pin-drop location unless you're connected to Wi-Fi at a place with a known IP, but it can pretty generally figure out what cell tower or broadband ISP you're connected to; that'll usually get within 50 miles or so. Easy enough to get your state if you're in the US, and probably even your city.
So when you request an episode from a podcast using dynamic ad insertion, the server does that lookup, figures out where you're from, and then chooses ads to insert: local ones if there are any, general ones if not. Then it loads up the local ads into the audio file, hopefully into preselected gaps in the audio. (And honestly, most servers actually pre-cache a bunch of these for big cities where there are a lot of subscribers.) Then they send the podcast, with ads inserted, to your phone.
Sometimes this gets weird; if you download a podcast while on vacation, for instance, or over a VPN (I'm almost always connected to a VPN, so I rarely get any local ads), or if you subscribe through a service that precaches your podcasts before your phone downloads them, so it's their IP address that starts this process rather than yours. And if it's really bizarre, you might not get any ads at all; this has happened to me on a few podcasts. They just throw to sponsors and immediately come back. That's kinda nice.