Tenjin SDK native extension

Here is an extension with basic implementation of Tenjin SDK for Defold: https://github.com/MaratGilyazov/def_tenjin

I said “basic” because I’ve implemented only what I needed right now (and even more - I don’t really need custom events), not all available APIs.

if tenjin then
  
  tenjin.init("YOUR_API_KEY", true)
  tenjin.custom_event("custom_event")
  tenjin.custom_event_with_value("custom_event", "10")

end

LUA Api

tenjin.init(string api_key, bool gdpr_consent)

Initializes Tenjin, call this before any other calls to Tenjin. This call is enough to track your installs.

  • api_key - is your API_KEY from your Tenjin Organization tab
  • gdpr_consent - boolean flag to forward your user’s consent regarding sensitive data; send true for “OptIn”, if permission are granted

tenjin.custom_event(string event_name)

Send custom event with event_name

tenjin.custom_event_with_value(string event_name, string event_value)

Send custom event with event_name and event_value. IMPORTANT! event_value should be send as a string BUT it should contain the integer value!

ATTENTION! Purchases tracking is not implemented!

Testing

See an official documentation describing how to test your integration: https://docs.tenjin.com/en/send-events/#check

Tested with Tenjin iOS SDK v1.9.1, under Mac Editor 1.2.165 on devices: iPhone XR, iPhone7.

If you need more native APIs supported - feel free to push your Pull Request :slight_smile:

10 Likes

Thank you for the contribution! Please submit it to the asset portal as well!

PS I haven’t heard of Tenjin before. Where did you hear of it? It’s it popular?

Tenjin is one of the attribution/tracking services. Well known alternatives are Appsflyer and Ajust (well, better say Tenjin is an alternative for these two). So it lets you separate paid installs from organic installs in your analytics.

Pros: Tenjin is free up to 1.000.000 monthly events (each app start generates an event), when Appsflyer and Ajust will cost you $0.05 and more per paid attribution (they don’t charge you for organic install as I remember, but simply saying your Cost Per Install will increase for at least 5 cents with them)

Cons: Tenjin is not an official Facebook partner (Appsflyer and Ajust are), so tracking installs from FB Ads is not supported for 100%, but is still possible via deferred deep links.

So, at first I wanted to try it because it’s free. And second - they have another feature/service of aggregating revenue from ads (via API from different ad networks you’re using for monetization) and I’m already using it (again - for free), so having also attribution by Tenjin will let me see Ads revenue exactly for cohorts of users I’ve aquired through exact ads campaigns.

4 Likes

Thanks! I’ve added this to the Asset Portal: https://defold.com/assets/tenjin/

2 Likes

Thanks for adding to the portal. I did not do that by myself because only partial iOS support is provided at the moment, but I guess it’s better than nothing. Going to add Android support during next week.

1 Like

I’ve tested Tenjin tracking on two small FB ad campaigns, everything seems working as expected, not 100% accuarte, but good enough. Also it’s possible to configure forwarding info about installs to GameAnalytics, that’s awesome!

  1. USA, $50 budget, acquired 48 installs -> tracked by Tenjin 44 installs -> forwarded to GameAnalytics 41 install [8-15% loss]

  2. Japan, $50 budget, acquired 67 installs -> tracked by Tenjin 67 installs -> forwarded to GameAnalytics 67 installs [0% loss]

Also Tenjin shows ads revenue per tracking campaign, it’s not true user-based revenue, but some estimation based on session number of the cohort)

5 Likes

Update: added Android support. Same methods support: init() and custom_event().
Still no support for purchases events.

2 Likes

Added IAP purchases events reporting: https://github.com/MaratGilyazov/def_tenjin/releases/tag/1.1

2 Likes