Easy Marketo landing page favicon

Adding a favicon to your Marketo landing page without personalised URLs and a redirect can’t be done in markup but is easy with a JavaScript snippet.

Marketo isn’t a subject I usually write about, but I’ve been working with it recently and their guided landing pages are fantastic. A designer can create a template with markup for editable areas and text, colour and toggle variables so non-technical people can create branded pages using a WYSIWYG editor. It’s all very snazzy.

You’d think you could just add favicon markup to the head of your template and be done with it, but Marketo adds the following snippet to the end of your head whether you want it to or not:

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">

If you have personalised URLs you can use a URL redirect (somewhere in the bowels of its administrative interface) so the default /favicon.ico redirects to your own on a separate domain. If you’re using default URLs you’ll need some codes for great good.

How to add your favicon

  1. Get the public URL for your desired favicon, e.g. https://richjenks.com/favicon.ico
  2. Add the following snippet before the closing </head> tag:
    <script>$("link[rel*=icon]").attr("href", "FAVICON_URL");</script>
    
  3. Replace FAVICON_URL with the URL to your favicon. Obviously.
  4. Profit.

2 Comments

  1. Hi Rich – This doesn’t work for me. My landing page still shows

    how can I redirect this link to a different one?

    • Hi Hitha, what are the URLs for your landing page and the desired favicon? Feel free to send them via the contact form on the left if you’d rather not post them in a public comment!

Leave a Reply

Your email address will not be published.