Line breaks are being added to Google Maps image URL in email code

Highlighted
Anonymous
Not applicable

Line breaks are being added to Google Maps image URL in email code

Hi everyone,

I am trying to include a Google Maps image in an email template as a background image. The URLs for these images, as generated by Google, are really long.

When working locally, everything is fine, but as soon as I upload my template into Marketo the map stops working because the URL is being split over multiple lines in the HTML.

This is what the URL looks like after it has been imported into Marketo, and also after it has been sent:

Screen Shot 2017-03-02 at 10.41.50 am.png

Line breaks are being added in two places. As soon as I remove them everything works as expected.

How can I prevent Marketo from adding line breaks to my code?

Any help much appreciated!

11 REPLIES 11
Highlighted
Level 10 - Community Moderator

Re: Line breaks are being added to Google Maps image URL in email code

Can you post the entire link so I can test it as-is?

Anonymous
Not applicable

Re: Line breaks are being added to Google Maps image URL in email code

Hey Sanford, thanks for the response! Here's a version of a test send online.

Highlighted
Level 10 - Community Moderator

Re: Line breaks are being added to Google Maps image URL in email code

I wanted the exact link before you added it to an email. Leave off the http: so Jive doesn't turn it into a link.

Highlighted
Anonymous
Not applicable

Re: Line breaks are being added to Google Maps image URL in email code

Right. Here it is:

maps.googleapis.com/maps/api/staticmap?¢er=37.7749295,-122.4194155&markers=icon:https://s3.amazonaws.com/templates.knak.io/58aba61f0d9c2/dynamic-lead-marker-white.png%7Csize:tiny%7Ccolor:white%7Clabel:MQL%7C37.7749295,-122.4194155&zoom=3&format=png&maptype=roadmap&style=element:geometry%7Ccolor:0x555555&style=element:labels%7Cvisibility:off&style=element:labels.icon%7Cvisibility:off&style=element:labels.text.fill%7Ccolor:0x616161&style=element:labels.text.stroke%7Ccolor:0xf5f5f5&style=feature:administrative%7Celement:geometry%7Cvisibility:off&style=feature:administrative.land_parcel%7Cvisibility:off&style=feature:administrative.land_parcel%7Celement:labels.text.fill%7Ccolor:0xbdbdbd&style=feature:administrative.neighborhood%7Cvisibility:off&style=feature:poi%7Cvisibility:off&style=feature:poi%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:poi%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:poi.park%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:poi.park%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:road%7Celement:geometry%7Ccolor:0xffffff&style=feature:road%7Celement:labels.icon%7Cvisibility:off&style=feature:road.arterial%7Cvisibility:off&style=feature:road.arterial%7Celement:labels.text.fill%7Ccolor:0x757575&style=feature:road.highway%7Celement:geometry%7Ccolor:0xdadada&style=feature:road.highway%7Celement:labels%7Cvisibility:off&style=feature:road.highway%7Celement:labels.text.fill%7Ccolor:0x616161&style=feature:road.local%7Cvisibility:off&style=feature:road.local%7Celement:labels.text.fill%7Ccolor:0x9e9e9e&style=feature:transit%7Cvisibility:off&style=feature:transit.line%7Celement:geometry%7Ccolor:0xe5e5e5&style=feature:transit.station%7Celement:geometry%7Ccolor:0xeeeeee&style=feature:water%7Celement:geometry%7Ccolor:0x777777&style=feature:water%7Celement:labels.text.fill%7Ccolor:0x9e9e9e;background-repeat:no-repeat;background-position:50%&size=600x300

over HTTPS.

Highlighted
Level 10 - Community Moderator

Re: Line breaks are being added to Google Maps image URL in email code

OK. It looks like there are at least two problems, but you only knew about the first one so far.

The first problem is that Marketo breaks the URL every 900 characters. No idea why -- this is not an actual limit anywhere else. But you can solve this by including a {{my.token}} with the URL. That gets printed as is, with no line breaks.  So actually this is the "Correct Answer" and you should open another thread because...

... you're going to have another problem that isn't a Marketo thing. In brief testing, I see that Gmail's image proxy breaks on these URLs. You'll have to do more testing on this. Check that your Maps API key is allowed to work on the webmail domains, for example.

Highlighted
Anonymous
Not applicable

Re: Line breaks are being added to Google Maps image URL in email code

Thanks for the response Sanford. Yes, the 900 character breaking remains the issue, and sadly for us using a token is not a solution. This will be a reusable template for our clients.

I haven't seen that issue with Gmail when I test from another ESP, but we'll look into it.

Thanks again for taking the time to confirm the issue.

Highlighted
Level 10 - Community Moderator

Re: Line breaks are being added to Google Maps image URL in email code

If it's a reusable template, presumably the URL is also static. So why not serve the URL as a redirect from a short URL @ your domain?

Highlighted
Anonymous
Not applicable

Re: Line breaks are being added to Google Maps image URL in email code

Cheers for the suggestion, I wish we could! The URL is not static though. We're using the Email Editor 2.0 and allowing user input to customise the map location, colours and place marker. So we want to populate certain values in the Google Maps URL with Marketo variables. It all works, until the URL gets broken into bits on send! Very frustrating.

Highlighted
Level 10 - Community Moderator

Re: Line breaks are being added to Google Maps image URL in email code

You could still redirect it even if it's variable-ized.  Send the variable parts of the URL, which will be under 900 chars. Your server redirects to the fleshed-out URL: solved.