0

I'm embedding Marketing Cloud forms with a iframe in my website. My form use Ampscript to redirect a Th page. the problem is that it load the thank you page within the iframe. Is there any way to open thank you page in a new tab. Where do I have to configure that? In iframe code, or in form amscript code?

I paste here a fragment of my amspcript code

 'OwnerId', @ownerId,
                    'Campaña', 'TEST')

                    IF @rs > 0 THEN
                                /* Redirect OK */
                                Redirect('mywebsite.com/thank-you/')
                    ELSE
                                /*Redirect KO*/
                                Redirect(CloudpagesURL(132))
                    ENDIF

and the iframe code:

    <div class="embed-container">
    <iframe width="560" height="315" style="border:none"
src="http://mymarketingcloudpage.com/form" frameborder="0" allowfullscreen></iframe>
</div>

Can anybody help me with this issue, please?

Best regards.

1 Answer 1

0

Ampscript won't be able to control what is going on outside of iframe, so I would suggesting changing the structure a bit:

  1. Create a new CloudPage that will you will redirect to that will contain only JavaScript that will be executed on load:

    <body onload="top.window.location.href='thankyou.html'> </body>
    
  2. You need to change the Ampscript to include your new CloudPage that will be there only to redirect to the real "Thank you" page.

Please note: The code above does not open the "Thank you" page in a new tab - it replaces the page on which the iframe is located. The reason for this is simple: browsers will block opening pages in new tabs as attempts to open pop-ups.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .