CMS Development

KathiNetpress
Participant | Diamond Partner
Participant | Diamond Partner

Smart Content in Thank you page - why not take some time to process?

SOLVE

Unfortunately I found out that smart content shouldn't be used in a thank you page by a practical example...also reading this now...

https://knowledge.hubspot.com/articles/kcs_article/cos-general/can-i-use-smart-content-on-a-thank-yo...

 

Isn't it possible to code some seconds after clicking the submit button and then redirecting to the thank you page?

1 Accepted solution
Jsum
Solution
Key Advisor

Smart Content in Thank you page - why not take some time to process?

SOLVE

@KathiNetpress something like this might work: 

 

$(document).ready(function () {
    $(window).load(function () {
        setTimeout(function(){
            $('#preloader').fadeOut('slow', function () {
            });
        },2000); // set the time here
    });  
});

But you'll want to use a preloader gif or something to signify something is happening for the sake of the user. 

 

Also, considering the template processes the python/jinja/HubL on the server side first then serves up the html/css/javascript to the client side where this would trigger, I am not entirely sure delaying the load of your thank you page would work. If you try it though please let me know. 

 

As far as delaying the landing page from redirecting the user, you would want to hook something like this up to be triggered by the form button click but I do not know how to delay the redirect. 

View solution in original post

2 Replies 2
Jsum
Solution
Key Advisor

Smart Content in Thank you page - why not take some time to process?

SOLVE

@KathiNetpress something like this might work: 

 

$(document).ready(function () {
    $(window).load(function () {
        setTimeout(function(){
            $('#preloader').fadeOut('slow', function () {
            });
        },2000); // set the time here
    });  
});

But you'll want to use a preloader gif or something to signify something is happening for the sake of the user. 

 

Also, considering the template processes the python/jinja/HubL on the server side first then serves up the html/css/javascript to the client side where this would trigger, I am not entirely sure delaying the load of your thank you page would work. If you try it though please let me know. 

 

As far as delaying the landing page from redirecting the user, you would want to hook something like this up to be triggered by the form button click but I do not know how to delay the redirect. 

KathiNetpress
Participant | Diamond Partner
Participant | Diamond Partner

Smart Content in Thank you page - why not take some time to process?

SOLVE

But where to put that code snippet in Hubspot?