Using the Envoy Pixel API
Find our Pixel Event API technical docs.
1 - What is the Envoy Pixel?
The Envoy Pixel API enables you to share analytics events with us. This is useful for events that are in your environment, namely your website or mobile app. You’ll then be able to see more precise conversion funnels and breakdowns in your Envoy dashboard.
Pro tip
Using the extra
field of the Pixel Event API, you can share anonymous data on user type or campaign to see advanced breakdowns in your Analytics dashboard. (e.g. {"campaign": "christmas", "userType": "premium"}
)
Make sure you only integrate these events if partner comes from Envoy, ie the property source=Envoy
is in the linkout url.
2 - The two main moments in the flow to trigger the Pixel
There are two main moments events can be sent:
Before the sharing flow: events with your subscriber. They have a
userId
you can share with us, the same one as in thecreate-link
function. Such events could be:loadGiftButton
,viewGiftButton
.After the sharing flow: events by your Envoy-sent potential lead. In case of gifting, they are the friend of your subscriber. No
userId
should be shared in this case, but asharerUserId
, corresponding to the id of the subscriber who shared the link in the first place.
3 - Suggested event names
We encourage you use those generic event names, so we can locate them more easily in the flow.
Before the flow
loadGiftButton
viewGiftButton
clickGenerateShareLink
viewShareDetailsModal
After the flow
startSignUpJourney
completeSignUpJourney
startFreeTrial
startPaidTrial
completesPurchase
4 - Code snippet
import requests
api_key = "----"
url = "https://api.envoy.is/partner/pixel-event"
pixel_payload = {
"eventName": "viewGiftButton",
"userId": "12",
"extra": {"campaign": "christmas", "userType": "premium"},
}
response = requests.post(
url,
headers={
"x-api-key": api_key,
"Accept": "application/json",
"Content-Type": "application/json",
},
json=pixel_payload,
)