Landing page template using tokens - problem with URL resolving

Erica_Harris2
Level 3

Landing page template using tokens - problem with URL resolving

I am trying to tokenise some landing page templates to use program tokens for URLs. My problem comes when I use a token in the following part of the template:

<div id="mktHeader" class="mktEditable">

<!-- Logo and Header -->

<div class="logo"><a href="{{my.Event page URL2}}"><img src="{{my.LP_Header Image}}" width="600" height="165"></a></div>

</div>

The value of the {{my.Event page URL2}} token (rich text) in the program is

https://www.owlstonemedical.com/about/events/, ​however, when I use it in a landing page created using the template, it resolves this as

http://info.owlstonemedical.com/www.owlstonemedical.com/about/events/

I previously tried it with a plain text token and am getting the same thing.

I have searched the community and the documentation and haven't been able to find the answer. I'm probably doing some rookie mistake, as templates are not my area of expertise, and I'm trying to tokenise one created by someone else.

There is this bit of JQuery which might conceivably be replacing the a href in the HTML, but I don't know JQuery at all: (I know the function is to register clicks on pdfs or ppts but it may be doing more than that?)

<script>

$jQ(document).ready(function() {

$jQ('a[href^="http://info"][href$=".pdf"], a[href^="http://info"][href$=".ppt"]').click(

function(e) {

mktoMunchkinFunction('visitWebPage', { url: $jQ(this).attr('href') });

}

).attr('target', '_blank');

});

</script>

- I would appreciate any advice!

Erica

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page template using tokens - problem with URL resolving

Nothing to do with that JS (though it is broken in its own right).

Most likely you've omitted the protocol (http:​// or https:​//) from the token value, which means the value is interpreted as a relative path.

The literal href

www.example.com/coogaga

will become

https:​//info.example.com/www.example.com/coogaga

using standard URL parsing rules.

Erica_Harris2
Level 3

Re: Landing page template using tokens - problem with URL resolving

No, as I posted above,

The value of the {{my.Event page URL2}} token (rich text) in the program is

https://www.owlstonemedical.com/about/events/

So I've included the protocol in the token value.

Erica_Harris2
Level 3

Re: Landing page template using tokens - problem with URL resolving

So I switched back to a text (instead of rich text) token, and found that works if I include the https:// in the token value.

You mention standard URL parsing rules, would you post a link to those?

Thanks for pointing me in the right direction -

Erica

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page template using tokens - problem with URL resolving

You mention standard URL parsing rules, would you post a link to those?

RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page template using tokens - problem with URL resolving

So I've included the protocol in the token value.

Using a Rich Text token doesn't result in a standards-compliant URL, so not really.

Erica_Harris2
Level 3

Re: Landing page template using tokens - problem with URL resolving

Hi Sandford,

Does that mean that for landing pages, you need to include the protocol in the URL, but to use the token in an email link and have it tracked, you need another token without the protocol? That is a bit of a pain!

- Erica

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page template using tokens - problem with URL resolving

Does that mean that for landing pages, you need to include the protocol in the URL, but to use the token in an email link and have it tracked, you need another token without the protocol? That is a bit of a pain!

Nope, you can use a single Text token (without the protocol) for both cases. There must be something else up with your testing.