Solved

Is there a possibility to influence whether a link opens in a new tab or follows the link?

  • 18 April 2023
  • 6 replies
  • 1058 views

Badge +1

When the newsletter is open in my browser, and I click a button, the link opens in a new tab. 
If I link an image and click it, it does not open a new window but " leaves" the newsletter and follows the link.

I would like all links to open in a new tab. Is there a setting in Klaviyo or a work around? Unfortunately I can't work with HTML and target blank.

icon

Best answer by Lanresdev 19 April 2023, 14:33

View original

6 replies

Userlevel 7
Badge +60

Hey @ninaJoya 

Welcome to the community and congrats on your first post! Happy to help!

It is expected behavior that all links, images and buttons open a new tab in your browser. If the linked images are not opening a new tab it could be because you have an extension installed in the browser that is preventing the new tab from opening or something is the browser settings that is interfering. Please check to verify that there are no extensions or settings that would prevent a new tab from opening. The only work around would be what you’ve already shared, to update the HTML source code and add your href link and include a target="blank"  property.

Hope this helps! Thanks again for being part of the community!

Badge +1

Hi @stephen.trumble thank you for your answer!

There is no extension installed, the problem also occurs on my colleaugues devices.

Also there’s no explanation on why the buttons do open in new tabs, but the links on pictures don’t. 

 

My idea was that maybe there is an option or setting in Klaviyo that manages the links globally.

 

 

Userlevel 2
Badge +7

Hello @ninaJoya 

 

Yes, there is a setting in Klaviyo that allows you to open all links in a new tab. Here's how you can do it:

  1. Go to the email template that you want to edit.
  2. Click on the button or image that you want to add the link to.
  3. In the Link field, enter the URL of the page that you want to link to.
  4. Click on the "Insert" button to add the link to the button or image.
  5. Click on the button or image again to edit it.
  6. In the Link field, add the following code to the end of the URL: ?target=_blank
  7. Click on the "Save" button to save your changes.

This code tells the browser to open the link in a new tab instead of the same tab. By adding this code to the end of all your links, you can ensure that they all open in a new tab.

If you have already added links to your email template and don't want to go through each one and add the code, you can use a find-and-replace tool to add the code to all the links in your email. Just search for all the links in your email and replace them with the same link plus ?target=_blank at the end.

I hope this helps! Let me know if you have any more questions.

Badge +1

@Lanresdev Thank you so much!

I wonder why I didn’t think of that 🤓

Userlevel 2
Badge +7

@ninaJoya  You’re welcome , If you have any issue you can always reach out , will be glad to help

 

@stephen.trumble 
@ninaJoya
@Lanresdev 


Hi,

I have mad a popup for collecting emails and added a custom trigger to that form, whenever user clicks on button popup appears popup has email input and button, I have added a url to my button which is a pdf , and the functionality is working fine but i want the file to be opened on new tab
I tried to add ?target=_blank in the end of my url but it is not working 

I have included this in my shopify theme,


<div><button class="klaviyo_form_trigger">DOWNLOAD CATALOGUE</button></div>

<script type="text/javascript">
    document.querySelector('.klaviyo_form_trigger').addEventListener('click', function (){
        window._klOnsite = window._klOnsite || [];
window._klOnsite.push(['openForm', 'FORMID']);
    });
</script>

 

Kindly help me with this

Reply