Re: Geolocation information at open

Phillip_Wild
Level 10

Hi all

What is the easiest way in Marketo to determine the location of a user at time of open? For example, you could use a user's location at open to show them the weather forecast in that location.

I know some third party services can do this but would prefer to do it in house.

Thanks, Phil

Tags (1)
21 REPLIES 21
Robb_Barrett
Level 10

PHIL -

Poking around, I found a service that does IP lookups based on header information in the email:Free Email Header Tracer | IP2Location

To test this, I used an email I received from Marketo.

Putting the headers in, here's how it routed:

Sender
Sender

IP Address10.160.25.53
LocationUnknown
Latitude, Longitude0, 0
Connection throughPrivate IP Address LAN
Local Time01 Dec, 2016 02:39 PM (UTC -)
Net Speed-
Area Code-
IDD Code-
ZIP Code-
Weather Station-
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation0m
Usage Type(RSV) Reserved

IP Address204.93.64.13
Location United States, California, Palo Alto
Latitude, Longitude37.443254, -122.149828 (37°26'36"W   -122°8'59"N)
Connection throughJive Software Inc.
Local Time01 Dec, 2016 10:39 PM (UTC -08:00)
Net SpeedDSL
Area Code650
IDD Code1
ZIP Code94301
Weather StationPalo Alto (USCA0830)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation8m
Usage Type(COM) Commercial

IP Address167.89.36.126
Location United States, Colorado, Denver
Latitude, Longitude39.749838, -104.995597 (39°44'59"W   -104°59'44"N)
Connection throughSendgrid Inc.
Local Time01 Dec, 2016 09:39 PM (UTC -07:00)
Net SpeedT1
Area Code303/720
IDD Code1
ZIP Code80202
Weather StationDenver (USCO0105)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation1608m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address8.16.0.17
Location United States, California, Los Angeles
Latitude, Longitude34.05223, -118.24368 (34°3'8"W   -118°14'37"N)
Connection throughLevel 3 Communications Inc.
Local Time01 Dec, 2016 10:39 PM (UTC -08:00)
Net SpeedT1
Area Code213/310/424/323
IDD Code1
ZIP Code90001
Weather StationLos Angeles (USCA0638)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation88m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address127.0.0.1
LocationUnknown
Latitude, Longitude0, 0
Connection throughLoopback
Local Time01 Dec, 2016 02:39 PM (UTC -)
Net Speed-
Area Code-
IDD Code-
ZIP Code-
Weather Station-
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation0m
Usage Type(RSV) Reserved

IP Address67.231.149.43
Location United States, California, Sunnyvale
Latitude, Longitude37.401247, -122.007521 (37°24'4"W   -122°0'27"N)
Connection throughProofpoint Inc.
Local Time01 Dec, 2016 10:39 PM (UTC -08:00)
Net SpeedT1
Area Code408/650
IDD Code1
ZIP Code94089
Weather StationSunnyvale (USCA1116)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation38m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address3.159.19.234
Location United States, Connecticut, Fairfield
Latitude, Longitude41.21835, -73.25173 (41°13'6"W   -73°15'6"N)
Connection throughGeneral Electric Company
Local Time01 Dec, 2016 07:39 PM (UTC -05:00)
Net SpeedCOMP
Area Code203
IDD Code1
ZIP Code06828
Weather StationFairfield (USCT0073)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation8m
Usage Type(COM) Commercial

IP Address3.159.146.22
Location United States, Connecticut, Fairfield
Latitude, Longitude41.21835, -73.25173 (41°13'6"W   -73°15'6"N)
Connection throughGeneral Electric Company
Local Time01 Dec, 2016 07:39 PM (UTC -05:00)
Net SpeedCOMP
Area Code203
IDD Code1
ZIP Code06828
Weather StationFairfield (USCT0073)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation8m
Usage Type(COM) Commercial

IP Address3.159.19.133
Location United States, Connecticut, Fairfield
Latitude, Longitude41.21835, -73.25173 (41°13'6"W   -73°15'6"N)
Connection throughGeneral Electric Company
Local Time01 Dec, 2016 07:39 PM (UTC -05:00)
Net SpeedCOMP
Area Code203
IDD Code1
ZIP Code06828
Weather StationFairfield (USCT0073)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation8m
Usage Type(COM) Commercial

IP Address3.159.19.197
Location United States, Connecticut, Fairfield
Latitude, Longitude41.21835, -73.25173 (41°13'6"W   -73°15'6"N)
Connection throughGeneral Electric Company
Local Time01 Dec, 2016 07:39 PM (UTC -05:00)
Net SpeedCOMP
Area Code203
IDD Code1
ZIP Code06828
Weather StationFairfield (USCT0073)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation8m
Usage Type(COM) Commercial

IP Address174.36.92.96
Location United States, Texas, Dallas
Latitude, Longitude32.93949, -96.83873 (32°56'22"W   -96°50'19"N)
Connection throughSoftLayer Technologies Inc.
Local Time01 Dec, 2016 08:39 PM (UTC -06:00)
Net SpeedT1
Area Code214/469/972
IDD Code1
ZIP Code75244
Weather StationDallas (USTX0327)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation128m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address174.36.80.208
Location United States, Texas, Dallas
Latitude, Longitude32.93949, -96.83873 (32°56'22"W   -96°50'19"N)
Connection throughSoftLayer Technologies Inc.
Local Time01 Dec, 2016 08:39 PM (UTC -06:00)
Net SpeedT1
Area Code214/469/972
IDD Code1
ZIP Code75244
Weather StationDallas (USTX0327)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation128m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address67.228.50.32
Location United States, Texas, Dallas
Latitude, Longitude32.93949, -96.83873 (32°56'22"W   -96°50'19"N)
Connection throughSoftLayer Technologies Inc.
Local Time01 Dec, 2016 08:39 PM (UTC -06:00)
Net SpeedT1
Area Code214/469/972
IDD Code1
ZIP Code75244
Weather StationDallas (USTX0327)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation128m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address75.126.253.0
Location United States, Texas, Dallas
Latitude, Longitude32.93949, -96.83873 (32°56'22"W   -96°50'19"N)
Connection throughJoe Scharf
Local Time01 Dec, 2016 08:39 PM (UTC -06:00)
Net SpeedT1
Area Code214/469/972
IDD Code1
ZIP Code75244
Weather StationDallas (USTX0327)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation128m
Usage Type(DCH) Data Center/Web Hosting/Transit

IP Address75.126.200.128
Location United States, Texas, Dallas
Latitude, Longitude32.93949, -96.83873 (32°56'22"W   -96°50'19"N)
Connection throughSoftLayer Technologies Inc.
Local Time01 Dec, 2016 08:39 PM (UTC -06:00)
Net SpeedT1
Area Code214/469/972
IDD Code1
ZIP Code75244
Weather StationDallas (USTX0327)
Mobile Country Code (MCC)-
Mobile Network Code (MNC)-
Carrier Name-
Elevation128m
Usage Type(DCH) Data Center/Web Hosting/Transit


You
You

    Here's the thing: I live outside Chicago, IL. The last place the email header shows for me is in Dallas Texas' weather station. As you can assume, my friends in Dallas are enjoying much better weather than I am in Chicago. This is due to the content and sender of the email - we route all external email through a service that checks the links and then re-sends a new version of the email to us that's been sanitized.  Even when I send a link directly from Marketo, our service (ProofPoint) first reads the emails, recodes the links so that it first goes to their service which pre-checks the links prior to allowing me to visit the site. It also re-writes the Subject line with EXT: to show me that it came from outside the company.

I tried another email - a P2P sent from one of my Co-workers in Vermont and this has a last connection of Fairfield, CT which is where GE's headquarters are located.

Now, there might be a better way to more accurately pin-point a person but it'd most likely need to be browser based.  When you do a search for "Location aware" you typically get sender-side location services or how to be location aware using an app, which as I expected is the best, most accurate method.

The next question I'd have is how it would work for offline emails?  What if I'm on a plane already?  Your email wouldn't work very well.  What if I'm travelling in a car or train?  I'll be passing through numerous.  What if I'm on a boat? (Queue Lonely Island.)

Robb Barrett
SanfordWhiteman
Level 10 - Community Moderator

But the trail of Received: headers has nothing to do with the IP address that fetches the images in the email.

That source  IP on the HTTP side may be an anonymizing proxy at a central site, to be sure, and so conceals the end-user's location -- even if that location is further hidden behind a VPN concentrator anyway -- but it's a different traffic path.

Note a *non-anonymizing* proxy isn't a problem as it will pass IP of earlier hops.

SanfordWhiteman
Level 10 - Community Moderator

FWIW just tested and Outlook.com, Yahoo! Mail, and standard Outlook/OWA don't anonymize, while Gmail does. This doesn't represent the full spectrum of corporate email protection, but it gives an initial lay of the land.

Phillip_Wild
Level 10

Thanks Sanford. We would be sending mostly to consumers with something like this - so it would be higher proportions of Gmail, Hotmail and the like. It seems they are more likely to anonymize.

SanfordWhiteman
Level 10 - Community Moderator

Hotmail doesn't anonymize. So from the "Big 3" webmails you have 2 of 3.

Phillip_Wild
Level 10

Haha! Yes, I can see how this breaks down very quickly. I might have some tough questions for a vendor or two next time they try to sell me on this!

The idea of requesting zipcode information from our subscribers, so we have something a bit more robust, seems like the way to go. If we determine the reward is worth the effort!

Thanks again.

SanfordWhiteman
Level 10 - Community Moderator

I wouldn't give up on it completely (save for the note above that even when it works with absolute precision, it's still only customizing the image and not the text).

But you should set a threshold for usability (if it works for x% of leads and has a y% effect on conversions) and have a graceful fallback or some kind of friendly disclaimer ("Local offers are approximate. Tell us your zipcode(s) to get the perfect content.").

Robb_Barrett
Level 10

I've seen emails from OKCupid* that do this - they'll say things like "It's raining, which means more people are browsing" or something like that. I don't know that they do it at time of email open since this would require a script, which many emails don't like.

If you have an app installed on their phone / device that's always allowed to run and has location services enabled, you can do this.  Otherwise, your best bet it to just assume that the person is in their hometown. Doing this in Marketo would be tricky since there's no separate object you could create to house location based events.  You'd need a separate service to monitor weather conditions and then submit ZIPs that are currently experiencing weather events and send off emails specific to those events.

Really, in Marketo it'd be simple: create an email for rain, snow, sun, lightning, tornado, tsunami, haboob, hurricane, etc. Whatever condition you want, then personalize it with the lead data. Have an external service that utilizes APIs to say "Send email RAIN to ZIP codes (00001, 00002, 00003, etc)"

Otherwise, what you're asking is for a subject line and email that knows location prior to send as you can't send script based dynamic code.

*I subscribe to a lot of email services for research purposes. Don't think I'm trying to cheat on my wife...she knows.

Robb Barrett
Phillip_Wild
Level 10

Hi Robb

While I'm not sure how it's done, I'm fairly sure that Movable Inc said that they could do it based upon the location at time of open. This seems like it would be contingent on privacy laws, location services on, etc etc...but now I'm not sure.

I like your idea of using the API to send only to specific zip codes. Clever. Not sure if I would trust our data enough for that though! In the example I was thinking of, I wouldn't be so explicit in the subject line since you're right, you can't know this prior to send. It would have to be a dynamic image sucked through at time of open. We're doing a similar thing with a content recommendation vendor, which got me thinking about the same thing for weather.

SanfordWhiteman
Level 10 - Community Moderator

While I'm not sure how it's done, I'm fairly sure that Movable Inc said that they could do it based upon the location at time of open. This seems like it would be contingent on privacy laws, location services on, etc etc...but now I'm not sure.

Phillip, location (wifi + GPS-assisted) can only be queried via JS.

So, even when viewed via webmail on a domain for which Location-Aware Browsing (or equivalent, that's the Firefox term) has been enabled by the end user, it's not possible for an individual email to send your device location. (The webmail app itself could query your location, o' course, but that is off-topic.)

So these services need to use IP-based geolocation, which is notoriously imprecise (not to say useless) due to database churn, proxies, and VPNs.

Robb_Barrett
Level 10

Likewise, because I typically use a VPN or secure service which routes me through WI, CT or CA whenever I use an auto-location service that's web based it's never right.  It's actually more work than the expected time savings, and it's been that way at several companies I work with that have off-site servers.

Robb Barrett
SanfordWhiteman
Level 10 - Community Moderator

It definitely defeats the concept of seeing if someone's on vacation if their source IP is the same datacenter all the time!

Phillip_Wild
Level 10

Super helpful. Thanks guys!

Robb_Barrett
Level 10

If you have access to the raw tracking logs then, perhaps, you might be able to read where the IP address is that's downloading the invisible GIF often used to track email opens. I don't know that Marketo exposes this data to the customer.

Let's run through this:

You send me an email. Inside the email is a link to an image with a unique name, such as asoydasoiduoq47e0qwui1r.png (pretend that's 32 characters). That image is defaulted to an image that's something like "Looking up your weather..."

I open your email

I download images

The service sees a unique GIF downloaded to track to my email address to an open

Reads the request header for IP address

ReverseIP to get location

Ping a weather service with ZIP of location

Read response from Weather API

Translate response to keywords, i.e. Rain

Select Rain.png

Copy rain.png to asoydasoiduoq47e0qwui1r.png

Trigger email to download the updated image

You're asking a lot to be done in a little time when only a small percentage of the population may be traveling when they open the email.

What I would do:

Look at {{lead.Postal Code}}

Verify that it's a real postal code IF {{lead.Postal Code}} IN LIST....  or do regular data cleanups to eliminate 11111

Translate this to a Metro Area field (you can purchase a ZIP list from the USPS that contains this information)

Outside of Marketo, create a webapp that looks for events and then calls on the Marketo API to trigger emails based on that event. Instead of the granular ZIP level, pass it at the Metro area for faster processing.

You have many less moving pieces this way. You can look to utilize Inferred IP address on the lead record (which I believe is only populated at lead creation) and compare it to the self provided info. You can also look to do data scrubbing to have your city/state and ZIP checked for accuracy.

I would build separate emails for all of the weather events. I know you can do it with script and segmentation but I feel better with separate assets.

Now, if this is something VITAL to your business, you should really look into either creating an App or partnering with an app that allows notification advertising. If you're in agriculture, for example, weather is ultimately a concern and there are farmers apps (You don't have to be lonely....) that would love more revenue from sponsored alerts.

When I used to work with Neolane, they promoted what they called SoLoMo - Social, Local, Mobile.  This is really what you're needing - the ability to tap into Geofences to trigger real time notifications.

Robb Barrett
Phillip_Wild
Level 10

Hi Robb

Good points! This question, like many of mine, is as much about pushing the limits of what's possible as opposed to what is practical and business critical

Thinking about it, I think the metro area idea could work very nicely. I'm thinking something like this...webhook passed to a program such as Zapier (which has some built in weather apps if you pass it latitude / longitude)....which passes back the weather, which is parsed out. This could potentially be done lead by lead, and as you mentioned, only sent to those which meet a certain weather criteria. Remove the scripting and just send to people where it's raining / snowing / hailing!

We're in travel, so you can see the applications - basically a "place you'd rather be" a la Corona's advertising.

Robb_Barrett
Level 10

You know, when the weather is REALLY bad in Chicago, the last thing I'm thinking about is wanting to travel. All I'm seeing on TV is "Flights cancelled, people sleeping in O'Hare, people who booked cruises SOL."

I honestly can't imagine anything I'd rather be doing than travelling. Being stuck at an airport, waiting for my flight to cancel, hoping I can find a hotel room to accommodate me...

Robb Barrett
SanfordWhiteman
Level 10 - Community Moderator

Webhook to Zapier to weather API is going to have terrible performance at scale. Much as I adore webhooks, you don't want to (/can't) scan your entire db daily.

Running such a job offline against your db, where you'll be able to leverage cached results, is more reasonable.

But the original design of dynamically generating an image at open time is actually pretty easy. Given a weekend, I could put the code together. However, the remaining problem, as you guys have alluded to, is more a marketing problem than a martech one: I can make the image say "It's raining in 10009!" but the rest of the copy will not be weather-aware.

Josh_Hill13
Level 10 - Champion Alumni

You have to use reverse IP lookup. Inferred geo fields can do this for you using that feature. For weather, you are better off using a third party service that's already built.

Phillip_Wild
Level 10

Interesting. Thanks Josh. I can see how that could work using Velocity scripting.

SanfordWhiteman
Level 10 - Community Moderator

At Email open, or at LP open?