Skip to main content
Contributor I
September 1, 2024
Solved

Triggering Active on Site Metric via Post API call

  • September 1, 2024
  • 2 replies
  • 140 views

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

    This topic has been closed for replies.
    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

    2 replies

    ArpitBanjara
    Principal User II
    Principal User II
    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

    Arpit Banjara - Lead Email Marketing Specialist at Flowium
    dilanxAuthor
    Contributor I
    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.