Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Added ecommerce tracking #6

Closed
wants to merge 1 commit into from

Conversation

gnestor
Copy link
Contributor

@gnestor gnestor commented Jan 15, 2016

No description provided.

@cbrevik
Copy link
Member

cbrevik commented Jan 15, 2016

Hi there! Thanks for the PR, I've been itching to get started on this feature. Glad to see someone beat me to it.

There are two points which I think is important when considering Ecommerce tracking;

  1. It should work for both iOS/Android (relevant for any new functionality really).
  2. For Android, the standard Ecommerce tracking has been deprecated in the latest SDK.

What I've been thinking of is implementing Enhanced Ecommerce transaction tracking for both platforms. Then we bypass the whole deprecation business, and it's possible to build upon it with more features as far as ecommerce tracking goes.

I have not tested the differences between the standard and enhanced tracking mechanisms for Ecommerce though. Maybe you are more familiar with it than me?

@gnestor
Copy link
Contributor Author

gnestor commented Jan 15, 2016

Nope I just started playing with ecommerce tracking today. I haven't dived into React Native for Android yet, so I don't know much about that either. Let me know how I can help!

@cbrevik
Copy link
Member

cbrevik commented Jan 17, 2016

Awesome! Well code-wise it seems really quite similar to your implementation, other than the fact that the product (equivalent to "item" in the standard tracking), and the ProductAction (equivalent to "transaction") needs to accompany an event or screenView hit.

For that event we'd probably want to let people define their own eventCategory and eventAction (even though they will likely name it something like the example, "Ecommerce" and "Purchase").

So I envision something like this for the JS API:
trackPurchaseEvent(product = {}, transaction = {}, eventCategory = "Ecommerce", eventAction = "Purchase"). In other words category/action are optional params with defaults.

The product object should have the following defintion;
{ productId, name, category, brand, variant, price, couponCode, quantity }
The transaction object should have the following definition;
{ transactionId, affiliation, revenue, tax, shipping, couponCode }

By the way, in your implementation I see you have included default values in the index.js for the objects, this should probably be avoided since they will vary depending on the country.

If you can do the iOS implementation, I can add onto that with an Android implementation. What do you think?

@gnestor
Copy link
Contributor Author

gnestor commented Jan 21, 2016

Sure why not? I just finished adding exception, social interaction, user ID, and iOS install tracking (you can see the branches: https://github.com/gnestor/react-native-google-analytics-bridge).

@gnestor
Copy link
Contributor Author

gnestor commented Jan 21, 2016

Ok I pushed to https://github.com/gnestor/react-native-google-analytics-bridge/tree/feature/enhanced-ecommerce

You will need to implement Android methods for trackException, trackSocialInteraction, setUser, and allowIDFA if you want to merge this branch into master. Otherwise, you can just take the trackPurchaseEnhanced method.

@cbrevik
Copy link
Member

cbrevik commented Jan 22, 2016

This is great work, thanks! I'll look into it this evening.

Looks like dependencies will have to be updated for allowIDFA, it requires libAdIdAccess.a. Also it might affect lead to app rejections in App Store. Have you looked into this?

@cbrevik
Copy link
Member

cbrevik commented Jan 25, 2016

Thanks for the great work! Since the work has diverged so much I made a new pull request.

@cbrevik cbrevik closed this Jan 25, 2016
@lock
Copy link

lock bot commented Sep 13, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants