Fixing Marketo pURLs

SanfordWhiteman
Level 10 - Community Moderator
Level 10 - Community Moderator

It's well-known​ that Marketo's pURL feature, out-of-the-box, has a fatal (and kinda fascinating) shortcoming. If someone has visited your site before — meaning either an anonymous or associated Munchkin session— then pURL-enabled pages aren't functional.

When there's an existing anonymous session, the server ignores the personalized part of the URL (the Marketo Unique Name /JillSmith02 or Unique Code /XYZPDQ) and serves up default/empty content.

On the other hand, if the person has never been to your site on their current device, pURLs work fine.

Unfortunately, then, pURLs work only for people who either [a] just got a new PC or phone or [b] have been living under a relative rock. Not exactly the widest audience!

Luckily, it's always been possible to fix the strange session behavior with a little JavaScript.

Read the full post on TEKNKL :: Blog →​

4141
5
5 Comments
Denise_Greenbe7
Level 3

Hi Sandy,

Still working on the PURLs project (in a discussion thread - but changing tactics and using a Marketo LP - and trying to display the PURL so these current questions dosn't belong there. Since you wrote the post in 2017, based on testing it seems that Marketo has at least fixed some of the shortcomings. E.g., "If someone has visited your site before — meaning either an anonymous or associated Munchkin session— then pURL-enabled pages aren't functional." I just set up a test and visited an LP with PURLS enabled using the URL with PURLs with 2 test leads that I know are cookied (i.e., I always use Firefox for test lead "Lucinda" and Chrome for test lead "Zephyr") and the PURLS displayed correctly.

However, when I visited the page from my iPhone using Safari and a different URL with PURL ("Ariel"), I seemed to run into this flaw - at least I think so. I'm not 100% positive I've visited the company's website before from my phone - but I think I probably have. At any rate, the PURL wasn't shown at all - so I'm guessing I'm dealing with this:
"When there's an existing anonymous session, the server ignores the personalized part of the URL (the Marketo Unique Name /JillSmith02 or Unique Code /XYZPDQ) and serves up default/empty content."

I read to your blog and added this (in bold) to the very top of the LP template header:

<!DOCTYPE html>

<html lang="en">

<head>

<!--Start Denise Added Test to Make PURLS work properly-->

<script id="teknklFormsPlus-base-1.0.3"

src="//cdpn-js.figureone.com/teknkl-formsplus-1.0.3.min.js">

</script>

<script id="teknklFormsPlus-purl-1.0.0"

src="//cdpn-js.figureone.com/teknkl-formsplus-purl-1.0.0.min.js">

</script>

FormsPlus.pURL.fixSession();

<!--End Denise Added Test to Make PURLS work properly-->

It didn't fix the problem or change the behavior in any way that I could discern. Also, now this displays on the LP when viewing it in the Marketo editor (although NOT when you go to the live page): "FormsPlus.pURL.fixSession();"

Have I done something wrong? (As you know, I'm not a developer so I blindly followed the directions).

Thank you!

Denise

Denise_Greenbe7
Level 3

UPDATE: Silly error on my part. When I used Safari on my iPhone I entered the wrong URL! Oops!

ALSO - reminder: this is for a direct mail campaign (not email).

Still would like to know your current take on what works or doesn't and if I applied your fix correctly. I especially want to know what to expect if "the person has never been to our site on their current device" - with your fix applied - would you expect the PURL to display? And (what is more important) should that activity appear in that person's activity log so they can be tracked? i.e., should using the PURL make Marketo recognize the person? Because I have now confirmed for myself that it if I use yet another browser on my PC - Edge - I remain anonymous even though I used a PURL to get to that LP. The PURL displays with the default token value - not the name in the PURL - and if I visit another page on the site and check "visited page today" in a smart list - not one is there.

The demand gen person here is (understandably) extremely concerned we need to know WHO came responded and came to the page. So far as I can tell, if that person hasn't been cookied on their current browser we simply can't tell.

(It occurs to me I should have mentioned that there is no Form on this page).

SanfordWhiteman
Level 10 - Community Moderator

Re: "expect the pURL to display", I always expect the page to display something. The question is (was) whether {{lead.tokens}}, for one example, pick up the pURL user. I agree that it looks like Marketo fixed this basic behavior without fanfare at some point, which is good.

Automatically associating the Munchkin session is another matter. Per the PM, this isn't expected behavior; the idea is the person still needs to submit a form, which is rather strange if you ask me. But there's a workaround. You can (I mean you, Denise, in particular) can use FlowBoost to generate Munchkin associator tokens for every relevant lead. Then you can output the {{lead.Munchkin Associator}} into the page and automatically bind the session to the known lead.

Denise_Greenb12
Level 7

Thank you, Sandy! Would love to know more about this. Let's schedule a time to talk. Please email me your availability.

Kaye_McClendon
Level 3

I just wanted to post the final correct code because I didn't see it anywhere. The fixSession() line needs to the have the <script> tags around it. 

 

<script id="teknklFormsPlus-base-1.0.3"
src="//cdpn-js.figureone.com/teknkl-formsplus-1.0.3.min.js">
</script>
<script id="teknklFormsPlus-purl-1.0.0"
src="//cdpn-js.figureone.com/teknkl-formsplus-purl-1.0.0.min.js">
</script>
<script>FormsPlus.pURL.fixSession();</script>