Skip to main content
Solved

Triggering Active on Site Metric via Post API call

  • September 1, 2024
  • 2 replies
  • 41 views

Forum|alt.badge.img+3

Hello,

I’m starting to learn APIs. I’d like to trigger an API call from PostMan.

I am using the Post - Create Client Event

Code looks like the below:

 

{

    "data": {

        "type": "event",

        "attributes": {

            "properties":

                { "browser":"firefox",

                    "os":"Windows",

                    "page":"http://www.example.com/landing"},

            "metric": {

                "data": {

                    "type": "metric",

                    "attributes": {

                        "name":"Active on Site"

 

But when I run the code it puts a 2nd metric in my klaviyo account with the same name, so I then have 2 metrics with the same name - Active on Site. Why is this?

How can I trigger the Active on Site metric that is in Klaviyo?

 

Dilan

Best answer by ArpitBanjara

Hey @dilanx 

Enabling onsite tracking is different for each ecommerce integration.

You do not need to add Klaviyo.js separately if you enabled active onsite tracking through one of the ecommerce integrations below:

  • Shopify
    Active on Site tracking is added automatically through the integration or through the Klaviyo app embed if it's toggled on.
  • BigCommerce
    Active on Site tracking is added when you integrate if you also check the setting Automatically add Klaviyo onsite JavaScript in Klaviyo.
  • WooCommerce
    Active on Site tracking is added automatically when you integrate.
  • Magento
    Active on Site tracking is added automatically when you integrate.
  • Wix 
    Active on Site tracking is added when you integrate if you also check the setting Automatically add Klaviyo onsite JavaScript in Klaviyo.

If you are using another ecommerce platform, or a custom platform, you can install Klaviyo.js manually.

more information on this here

I hope this helps

Cheers

Arpit Banjara

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

2 replies

ArpitBanjara
Principal User I
Forum|alt.badge.img+36
  • Principal User I
  • 371 replies
  • Answer
  • September 2, 2024

Hey @dilanx 

Enabling onsite tracking is different for each ecommerce integration.

You do not need to add Klaviyo.js separately if you enabled active onsite tracking through one of the ecommerce integrations below:

  • Shopify
    Active on Site tracking is added automatically through the integration or through the Klaviyo app embed if it's toggled on.
  • BigCommerce
    Active on Site tracking is added when you integrate if you also check the setting Automatically add Klaviyo onsite JavaScript in Klaviyo.
  • WooCommerce
    Active on Site tracking is added automatically when you integrate.
  • Magento
    Active on Site tracking is added automatically when you integrate.
  • Wix 
    Active on Site tracking is added when you integrate if you also check the setting Automatically add Klaviyo onsite JavaScript in Klaviyo.

If you are using another ecommerce platform, or a custom platform, you can install Klaviyo.js manually.

more information on this here

I hope this helps

Cheers

Arpit Banjara


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 1 reply
  • September 2, 2024

I'm trying to trigger a flow without having a store.

Is it possible for me to trigger the flow for Active on Site, using just an API call? 

Basically I want to test my flows without having to actually trigger them as a customer.