Solved

Integration to Wordpress


Badge +1

Hi,

 

Can anyone help and let us know how to integrate Klaviyo onto Wordpress but not WooCommerce.  We used WP to develop our website but we are selling services, not products, so we don’t need an eCommerce platform, hence not using WooCommerce.

Thanks for your help!

Kev

icon

Best answer by Dov 17 May 2022, 23:23

View original

13 replies

Userlevel 7
Badge +61

Hi @Hol2022,

Thanks for sharing your question with us.

To achieve this, you would need to manually install the Klaviyo javascript to your WordPress site, which would allow you to create and add a form to your site. Once you do this, you can begin to collect subscribers from your site.

You can use the below snippet to manually install the Klaviyo onsite javascript necessary to publish Signup Forms on your WordPress site.

<script type="application/javascript" asyncsrc="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>

Make sure to replace PUBLIC_API_KEY with your Klaviyo account's 6 character Public API Key.

I hope that’s helpful!

Badge +1

Mr. Dov

 

i added this JS code in my header and footer plugin, how can i add a form in elementor its not working i tried, i added the 6 character Public API key,

 

On my site i just want to get clients email and auro respond with a welcome message and will follow the client later,  please your support.

 

Kind Regards

Userlevel 5
Badge +18

@shaiz 

I haven’t explored all the options of using Elementor forms with Klaviyo but will be trying soon.

 

Here is another thread that talks about WP plugins you can use: 

 

You could also use Zapier for this. You catch the Elementor form entry through a webhook and then send the data to Klaviyo. This I have already tested so I could create a submitted form metric event in Klaviyo, but you could use just for creating or updating a subscriber. 

https://elementor.com/help/zapier-elementor-integration/

Badge

I have used the script

 

<script type="application/javascript" asyncsrc="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>

 

Replacing the PUBLIC_API_KEY with my own and put it in the head section but it still doesn not connect to Klaviyo.

 

Is there any other place I need to put it?

 

Many thanks,

Mark

Userlevel 7
Badge +61

Hi @MarkCU & @shaiz,

Thanks for your follow-up notes.

Here are some other options you can try.

OPTION 1:

Add Klaviyo’s onsite javascript code as a snippet within WordPress

yof1aaCSpm4xICpCL52lwAJUfqUjh2AbpW2icGdBlEIhYeMc0EMdPn_VSJK-SvBbPh5E_MpvAD3k9PsVNVSVnffop_hue4DL5XWjH1WPhYxEmQt6jbQVA1N8ZRhWmQtmy6JbRnMm=s0

OPTION 2: 

Add Klaviyo’s onsite javascript code as a Footer widget within WordPress

O6PynoqH79fgkVw0Id-5b17DjsGe2SZket3XhdNSO0HM6I6rq9V9lCIFHpG9DlGg5IyB1--cglG_OtY1u8L9ZFWeUd6Q10FbfwigpMpnb1JfrLxzNI1WNj0YKONDBFb3CzJpM5IS=s0

OPTION 3:

Wrap the Klaviyo onsite javascript within a PHP Function, so that it can be added into your functions.php file, as explained here:

add_action('wp_footer', 'my_custom_footer_js'); function my_custom_footer_js() {   echo '<p><script async type="text/javascript" src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script></p>'; }

OPTION 4:

If the PHP Function above does not work, then ultimately you will need to use a plugin such as this one

I hope that’s helpful. 

Badge +1

Hello! Follow up on this thread.. @Dov I was able to successfully embed a Klaviyo form using option number 3 (php function). However, since it is rooted in the footer I can not embed a form on a page where I do not display my footer and header (aka a landing page). Do you know any work around this?

Userlevel 7
Badge +36

Hi @drewyoga!

 

Taking over for Dov here - I think your best bet would be to use a code snippet plug-in like this.

 

If you’re not able to do that, then it may be useful to reach out to Wordpress Support and inquire about snippet-insertion options other than a php function, since they would likely have more insight into this.

 

Thanks,

- Brian

I’m having an issue with integrating with WordPress as well.

I’ve inserted the code snippet into the body using the Code Snippets plugin.

I keep receiving this error: “Script was not installed correctly”. I can see the code is on the site though.

Please advise.

I’m having the same issue, has anyone found a fix? I’ve tried all of the solutions, and the script appears in the source code of my pages, but Klaviyo is still returning errors that the script is not installed correctly.

Also, the documentation says that just installing the plugin should do this, but then above it is stated you have to do it manually. Which is it?

Unlike many others, our site https://gbwpro.com/ is focused on providing services rather than products, so we opted not to use WooCommerce. We're looking for guidance on how to seamlessly integrate Klaviyo without the WooCommerce framework. We want to leverage Klaviyo for email marketing and audience engagement tailored to our services. 

Our website primarily offers services rather than products, we decided against using WooCommerce for our setup. However, I'm eager to leverage Klaviyo's powerful features for effective email marketing. Following the recommended steps, I installed the Klaviyo plugin on boating safety WordPress site, obtained the API key, and configured the settings accordingly. 

I have successfully integrated Klaviyo with your WordPress site for your service-based business. Everything seems to be working smoothly, with form submissions being captured accurately. However, I've noticed an anomaly in the tracking data. I placed the Klaviyo tracking code correctly in the WordPress header using the "Insert Headers and Footers" plugin, the analytics tool is not reflecting page view events as expected.  

This script has a typo

<script type="application/javascript" asyncsrc="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>

asyncsrc should be async=””

 

and the script

<script type="application/javascript" async=”” src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=PUBLIC_API_KEY"></script>

Reply