I created custom tag Klaviyo tag for Google Tag Manager Server Side
And use it on my site for tracking user events as an alternative to Klaviyo JS library. (I do this for better page speed. In my case your js library does not download to the user browser.)
My solution uses your server side api
But I have an issue with tracking "Active on Site". I don't find a way to do this from server side.
1) Is there a possibility to track this on server side or I can do this only with your JS script?
2) Do you plan to add this option to the server side api?
3) Maybe you have a workaround for this now?
Best answer by cbarley
To answer your question, there are a couple ways to figure out how to spoof an Active On Site event through the Serverside API. The best way to tell is from the network tab in the Chrome Dev Tools, but there’s technically 2 ways to spoof it:
- On any onsite event, include $is_session_activity=true. It gets picked up and used to generate/update an Active on Site event with a new url and timeframe.
To track it just by itself (ie to mimic a person just bouncing around on the page and not triggering other events) there’s a specific event name and structure. Here’s an example that I sent from my own account:
Referrer and last referrer are necessary though, those are just reserved profile properties that hydrate that “how they found you” section on a profile, which our cookie tracks by default
Let me know if you have follow up questions after testing!