Using the Envoy Pixel API
1 - What is the Envoy Pixel?
Section titled “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.
2 - The two main moments in the flow to trigger the Pixel
Section titled “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
userIdyou can share with us, the same one as in thecreate-linkfunction. 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
userIdshould 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
Section titled “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
loadGiftButtonviewGiftButtonclickGenerateShareLinkviewShareDetailsModal
After the flow
startSignUpJourneycompleteSignUpJourneystartFreeTrialstartPaidTrialcompletesPurchase
4 - Code snippet
Section titled “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,)