Skip to main content

$.ajax({

headers: {

Accept: "text/html",

"Content-Type": "application/x-www-form-urlencoded",

"Authorization": "WfkrbC"

},

type: 'POST',

url: 'https://a.klaviyo.com/api/track',

success: function (response) {

console.log('sent');

console.log('------>', response);

}

});

 

Hi, can someone help what is wrong in my code, the issue shows in my console is BLOCKED BY CORS POLICY ISSUE

What im trying to achieve here is to see, if the track api is working

Hi @jowin!

It appears you’re trying to create an event in the front-end, but the endpoint you’re using is meant for server-side calls only, which is why you’re receiving that error. Instead, I would recommend one of these two alternative APIs:

 

I hope this helps, and thanks for using the Community!

- Brian


Reply