Skip to main content
Solved

Disable the newsletter form in the client.


Forum|alt.badge.img+2

Hi, 

I have some situations where I don't want to show the newsletter because I know that the user is enrolled but I don’t know its id.

Is there a way to tell the client api to not show the form?

Best answer by alex.hong

Hello @Theweban ,

I believe something like this can be accomplished in one of two ways; by using either a targeting behavior set on your form or by setting up a custom trigger for the form. 

If these contacts originating from your Facebook ads were added to a list or somehow can be captured by a segment, you should be able to target these specific visitors by using the Target visitors in a list or segment under the signup form’s Targeting settings. Here are Community posts I’ve linked below related to this:

If these visitors aren’t being added to a list or cannot be captured through a segment, you can always use the option of a custom trigger. Using a custom trigger will allow you more flexibility as it would offer you the capability to trigger the form based on the behaviors you desire; in this case to only trigger for visitors originating from Facebook. Since this option would require some custom coding to be implemented on your site, we suggest working with a developer you’re familiar with or working with some of our fantastic Klaviyo Partners

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • October 11, 2022

Hello @Theweban ,

Welcome to the Community.

I think to better understand what might be causing this you would have to share details such as integration type, how the newsletter is set to appear, etc.

 

Return with that info and we can probably get a better understanding of what is going on.


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • October 12, 2022

Hi, I'll try.

I'm preparing a lead ads from Facebook. The lead will automatically as the user to a klaviyo list and then the user will be send to our shopify store.

 

In the other hand, we have a shopify-klaviyo integration who show a registering form to our newsletter when the user is not identified by klaviyo scripts.

 

In that scenario, when a use is registered using lead ads, I'll don't know who is him, so I can't identify him, but I know that is a newsletter registered user and we don't want to show the klaviyo's newsletter registration form, so I want to disable it. 

 

It's there a way to do that?.

 

 

 

 


alex.hong
Forum|alt.badge.img+58
  • Klaviyo Alum
  • 1552 replies
  • Answer
  • October 12, 2022

Hello @Theweban ,

I believe something like this can be accomplished in one of two ways; by using either a targeting behavior set on your form or by setting up a custom trigger for the form. 

If these contacts originating from your Facebook ads were added to a list or somehow can be captured by a segment, you should be able to target these specific visitors by using the Target visitors in a list or segment under the signup form’s Targeting settings. Here are Community posts I’ve linked below related to this:

If these visitors aren’t being added to a list or cannot be captured through a segment, you can always use the option of a custom trigger. Using a custom trigger will allow you more flexibility as it would offer you the capability to trigger the form based on the behaviors you desire; in this case to only trigger for visitors originating from Facebook. Since this option would require some custom coding to be implemented on your site, we suggest working with a developer you’re familiar with or working with some of our fantastic Klaviyo Partners


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • October 12, 2022
alex.hong wrote:

…..

If these visitors aren’t being added to a list or cannot be captured through a segment, you can always use the option of a custom trigger. Using a custom trigger will allow you more flexibility as it would offer you the capability to trigger the form based on the behaviors you desire; in this case to only trigger for visitors originating from Facebook. Since this option would require some custom coding to be implemented on your site, we suggest working with a developer you’re familiar with or working with some of our fantastic Klaviyo Partners

Great! Looks like custom trigger is the best fit for me.

I will trigger with window._klOnsite.push('openForm', 'FormID'); if not identified and not come from some origins.

Do you know if teaser works in the same way than starting automatically?

Thanks!

 


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • October 13, 2022

Looks like teaser functionality is lost using openForm.

 

So for future references, this is how I finally implement.

So I take a 3th way. That is enable form automation give to it a huge time to show the form. Then use my own behavior to show the form when needed or hide te teaser.

 

This is the code implemented.

  <script>
    //wait until teaser exists and then hide it.
    function hide_teaser(form_id) {
      if (!document.getElementsByClassName('kl-teaser-'+form_id).length) {
        setTimeout(hide_teaser, 100, form_id);
        return;
      }
      document.getElementsByClassName('kl-teaser-'+form_id)[0].style.display='none';
      console.log('Hidding '+form_id);
    }
    //Start custom teaser and form behavior. 
    function my_init_kl(){
     //Wait until _learnq is well loaded and started.
     if(!window._learnq || !window._learnq.isIdentified) {
      setTimeout(mqa_init_kl, 100);
      return;
     }
     //If we don have to show the teaser and form, hide it.
     if(discookie != null || _learnq.isIdentified()) {
      if(navigator.userAgentData.mobile) {
        hide_teaser('RfQRWs');
      }
      else {
        hide_teaser('R37UUW');
      }
     }
     else {  //show the form after a while
      if(navigator.userAgentData.mobile) {
        setTimeout(function(){
          if(!_learnq.isIdentified()) {
            _klOnsite.push(['openForm', 'MOB-Form']);}
          }, 35000);
        }
        else {
          setTimeout(function(){
            if(!_learnq.isIdentified()) {
             _klOnsite.push(['openForm', 'PC-FORM']);}
            },35000);
        }
    }
  }
  setTimeout(my_init_kl, 200);
  </script>