Re: Java Script to make PDF load when land on Landing Page

Sara_Underwood
Level 2

Java Script to make PDF load when land on Landing Page

Hi all,

My team wants to be able to provide a PDF via their own emails (not using MSI/Marketo) that will still allow us to track in Marketo. They don't want a form and they don't want them to have to do two clicks, one in the email and one on the landing page. They just want the PDF to load once someone lands on the landing page. So I thought that I could create a landing page so we can track people who view it, and put some script on the landing page that lets the PDF load after landing on the landing page.

Is this possible? Can anyone help me with the script? I've been searching and can't find anything! I'm not a developer and unfortunately, I don't know any coding.

Thanks in advance for any help!

Sara

11 REPLIES 11
Josh_Hill13
Level 10 - Champion Alumni

Re: Java Script to make PDF load when land on Landing Page

Sara,

Yes, you would need a developer to provide the script. I've done this before where the form fill leads to an auto pop up. We found this led to complications with expected behaviors (like most people know they are going to next steps, not the pdf) and tracking.

From the description of your use case, I would recommend uploading the PDF to any server, provide THAT *.pdf link to the email and record the click.


Now, if sales are sending out emails in outlook or Gmail, you can have them install the MSI plugin that just lets them track things w minimal interference.

Unfortunately, if you really want to go to the LP experience that forces a pdf to pop up, you will need javascript and some people who turn off javascript (rare these days) will not get the pdf properly. Again, I do not recommend this because it doesn't work well.

Sara_Underwood
Level 2

Re: Java Script to make PDF load when land on Landing Page

Thank you, Josh! Unfortunately, our salesforce isn't really using MSI yet. I just came on board here and am trying to teach everyone the benefits of Marketo as a whole, including MSI.

If I put the PDF in marketo and they still sent the email out of gmail/outlook, it wouldn't track in Marketo if they clicked that link or viewed that PDF. At least that is what I've been told -- since that email isn't a Marketo one and the marketo pdf links aren't actually cookied.

If I redirect a blank landing page, would that work? Or do they need to be on the landing page for a few seconds to be tracked? I meant to add this option in my original question.

Kenny_Elkington
Marketo Employee

Re: Java Script to make PDF load when land on Landing Page

You just need to add a meta tag to refresh a bounce page to your PDF url:

<meta http-equiv="refresh" content="3;url=http://www.example.com/" />

In content, 3 is the number of seconds to wait, and you just replace the url with your pdf url.  Put it in the <head> of your bounce page and it will redirect after the set number of seconds.

Anonymous
Not applicable

Re: Java Script to make PDF load when land on Landing Page

Alternatively, I think you could just construct a super simple Marketo landing page and insert a large iframe with the PDF url. It will appear with pdf loaded onto the page, but only the parent Marketo page URL will be tracked.

SanfordWhiteman
Level 10 - Community Moderator

Re: Java Script to make PDF load when land on Landing Page

Nice, I agree this is a faster approach because Munchkin will load asynchronously and you don't need a best-guess-delay.  It won't always render the PDF in the page, though. Depends on the PDF reader app/plug-in whether it will download or display.

Sara_Underwood
Level 2

Re: Java Script to make PDF load when land on Landing Page

Hi Michael,

Great idea! I've tried doing this and I succeed when it's on the desktop, but I can't get it to scroll when it's on mobile, specifically iphone. Any thoughts?

Here's my script I created with an iframe generator:

<iframe

src="https://marketing.acxiom.com/rs/982-LRE-196/images/Acxiom_Guide-to-New-Leads-Better-Customers.pdf" height="1200" width="900" frameborder="0" scrolling="yes">You need an iframes capable browser to view this content.</iframe>

What am I missing? Thanks!!

Anonymous
Not applicable

Re: Java Script to make PDF load when land on Landing Page

Dropping that in didnt create a vertical scrolling issue for me, but I was only viewing in an emulator, not an actual device.

You could always add a media query to make your width "100%" at smaller screen sizes, that way you wouldnt have to worry about left right scrolling.

Additionally, if you are viewing it on iOS, this might be a solution worth trying:https://www.joomlacontenteditor.net/support/forum/iframe-no-scrolling-on-ipad-iphone

Sara_Underwood
Level 2

Re: Java Script to make PDF load when land on Landing Page

Thanks so much, Michael. Not sure how to add that media query like you suggested, but that link has pointed me in the right direction... I think!

JD_Nelson
Level 10 - Community Advisor

Re: Java Script to make PDF load when land on Landing Page

These are really good ideas and will find ways to track and distribute your content, simply. I would point out that you may get unknown people to your page, or, if the click isn't tracked, then munchkin won't necessarily know the end user. What I've done, to keep Marketing value, but still appease Sales' request for a simpler process, is to segment the page by Known User so a form appears if we don't end up knowing who the user is. HOPEFULLY, this wouldn't be a majority of your visits, but will provide a failsafe to cover yourself for ROI discussions. You always want to make sure you track all visits.

just a thought...