|
37 | 37 | - [Track Content](#track-content)
|
38 | 38 | - [Track User](#track-user)
|
39 | 39 | - [Track Event](#track-event)
|
| 40 | + - [Track Commerce](#track-commerce) |
40 | 41 | - [Handle Referrals](#handle-referrals)
|
41 | 42 | - [Troubleshooting](#troubleshooting)
|
42 | 43 | - [Testing: Key Points](#testing-key-points)
|
|
47 | 48 | - [Testing: Sample Test App](#testing-sample-test-app)
|
48 | 49 | - [Link Data: Universal Object Properties](#link-data-universal-object-properties)
|
49 | 50 | - [Link Data: Deep Link Properties](#link-data-deep-link-properties)
|
| 51 | + - [Link Data: Commerce Properties](#link-data-commerce-properties) |
50 | 52 | - [Compiling: Cordova Dependencies](#compiling-cordova-dependencies)
|
51 | 53 | - [Compiling: Show Console Logs](#compiling-show-console-logs)
|
52 | 54 | - [Compiling: Updating the Branch SDK](#compiling-updating-the-branch-sdk)
|
|
69 | 71 | <!-- sample config.xml -->
|
70 | 72 | <widget id="com.eneff.branch.cordovatestbed" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
71 | 73 | <!-- Branch -->
|
72 |
| - <plugin name="branch-cordova-sdk" spec="^2.5.0" /> |
| 74 | + <plugin name="branch-cordova-sdk" spec="^2.6.0" /> |
73 | 75 | <branch-config>
|
74 | 76 | <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
|
75 | 77 | <uri-scheme value="branchcordova" />
|
|
83 | 85 | <!-- sample config.xml -->
|
84 | 86 | <widget id="com.eneff.branch.cordovatestbed" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
|
85 | 87 | <!-- Branch -->
|
86 |
| - <plugin name="branch-cordova-sdk" spec="^2.5.0" /> |
| 88 | + <plugin name="branch-cordova-sdk" spec="^2.6.0" /> |
87 | 89 | <branch-config>
|
88 | 90 | <branch-key value="key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3" />
|
89 | 91 | <uri-scheme value="branchcordova" />
|
|
476 | 478 |
|
477 | 479 | - #### Track Event
|
478 | 480 |
|
479 |
| - - Registers custom events |
| 481 | + - Registers a custom event |
480 | 482 |
|
481 | 483 | - Events named `open`, `close`, `install`, and `referred session` are Branch restricted
|
482 | 484 |
|
483 |
| - - Recommened to [Track User](#track-user) before [Track Event](#track-event) to associate custom events with a user |
| 485 | + - Recommended to [Track User](#track-user) before [Track Event](#track-event) to associate custom events with a user |
484 | 486 |
|
485 | 487 | - Verify on the [Branch Dashboard](https://dashboard.branch.io/liveview/events)
|
486 | 488 |
|
|
503 | 505 | })
|
504 | 506 | ```
|
505 | 507 |
|
| 508 | +- #### Track Commerce |
| 509 | + |
| 510 | + - Registers a custom commerce event |
| 511 | + |
| 512 | + - Recommended to [Track User](#track-user) before [Track Commerce](#track-commerce) to associate commerce events with a user |
| 513 | + |
| 514 | + - [Track commerce properties](#link-data-commerce-properties) for `Currency` and `Category` |
| 515 | + |
| 516 | + - Verify on the [Branch Dashboard](https://dashboard.branch.io/liveview/commerce) |
| 517 | + |
| 518 | + ```js |
| 519 | + // only revenue is required |
| 520 | + var event = { |
| 521 | + 'revenue': 50.29, |
| 522 | + 'currency': 148, // USD |
| 523 | + 'transactionID': 'transaction id', |
| 524 | + 'coupon': 'coupon', |
| 525 | + 'shipping': 2.22, |
| 526 | + 'tax': 5.11, |
| 527 | + 'affiliation': 'affiliation', |
| 528 | + 'products': [ |
| 529 | + { |
| 530 | + 'sku': 'u123', |
| 531 | + 'name': 'cactus', |
| 532 | + 'price': 4.99, |
| 533 | + 'quantity': 2, |
| 534 | + 'brand': 'brand', |
| 535 | + 'category': 17, // Software |
| 536 | + 'variant': 'variant' |
| 537 | + }, |
| 538 | + { |
| 539 | + 'sku': 'u456', |
| 540 | + 'name': 'grass', |
| 541 | + 'price': 0.00, |
| 542 | + 'quantity': 1 |
| 543 | + } |
| 544 | + ] |
| 545 | + } |
| 546 | + |
| 547 | + // optional fields |
| 548 | + var metadata = { |
| 549 | + 'custom_dictionary': 123, |
| 550 | + 'anything': 'everything' |
| 551 | + } |
| 552 | + |
| 553 | + Branch.sendCommerceEvent(event, metadata).then(function (res) { |
| 554 | + console.log(res) |
| 555 | + alert('Response: ' + JSON.stringify(res)) |
| 556 | + }).catch(function (err) { |
| 557 | + console.error(err) |
| 558 | + alert('Error: ' + JSON.stringify(err.message)) |
| 559 | + }) |
| 560 | + ``` |
| 561 | + |
506 | 562 | - #### Handle Referrals
|
507 | 563 |
|
508 | 564 | - Referral points are obtained from events triggered by users from rules created on the [Branch Dashboard](https://dashboard.branch.io/referrals/rules)
|
|
598 | 654 | <link-domain value="bnc.lt" /> <!-- optional previous link domain -->
|
599 | 655 | <ios-team-release value="PW4Q8885U7" /> <!-- required if iOS app -->
|
600 | 656 | <ios-team-debug value="FG35JLLMXX" /> <!-- optional -->
|
601 |
| - <android-prefix value="/WSuf" /> <!-- optional (for bnc.lt) --> |
| 657 | + <android-prefix value="/WSuf" /> <!-- optional (for bnc.lt and custom domains) --> |
602 | 658 | <android-testmode value="true" /> <!-- optional (simulate installs) -->
|
603 | 659 | </branch-config>
|
604 | 660 | ```
|
|
794 | 850 | | $twitter_player_width | | Set the player’s width in pixels
|
795 | 851 | | $twitter_player_height | | Set the player’s height in pixels
|
796 | 852 |
|
| 853 | +- #### Link Data: Commerce Properties |
| 854 | + |
| 855 | + - For [Track Commerce](#track-commerce) |
| 856 | + |
| 857 | + | Value | Category | |
| 858 | + | --- | --- | |
| 859 | + | 0 | Animals & Pet Supplies | |
| 860 | + | 1 | Apparel & Accessories | |
| 861 | + | 2 | Arts & Entertainment | |
| 862 | + | 3 | Baby & Toddler | |
| 863 | + | 4 | Business & Industrial | |
| 864 | + | 5 | Camera & Optics | |
| 865 | + | 6 | Electronics | |
| 866 | + | 7 | Food, Beverage & Tobacco | |
| 867 | + | 8 | Furniture | |
| 868 | + | 9 | Hardware | |
| 869 | + | 10 | Health & Beauty | |
| 870 | + | 11 | Home & Garden | |
| 871 | + | 12 | Luggage & Bags | |
| 872 | + | 13 | Mature | |
| 873 | + | 14 | Media | |
| 874 | + | 15 | Office Supplies | |
| 875 | + | 16 | Religious & Ceremonial | |
| 876 | + | 17 | Software | |
| 877 | + | 18 | Sporting Goods | |
| 878 | + | 19 | Toys & Games | |
| 879 | + | 20 | Vehicles & Parts | |
| 880 | + |
| 881 | + | Value | Currency | |
| 882 | + | --- | --- | |
| 883 | + | 0 | AED | |
| 884 | + | 1 | AFN | |
| 885 | + | 2 | ALL | |
| 886 | + | 3 | AMD | |
| 887 | + | 4 | ANG | |
| 888 | + | 5 | AOA | |
| 889 | + | 6 | ARS | |
| 890 | + | 7 | AUD | |
| 891 | + | 8 | AWG | |
| 892 | + | 9 | AZN | |
| 893 | + | 10 | BAM | |
| 894 | + | 11 | BBD | |
| 895 | + | 12 | BDT | |
| 896 | + | 13 | BGN | |
| 897 | + | 14 | BHD | |
| 898 | + | 15 | BIF | |
| 899 | + | 16 | BMD | |
| 900 | + | 17 | BND | |
| 901 | + | 18 | BOB | |
| 902 | + | 19 | BOV | |
| 903 | + | 20 | BRL | |
| 904 | + | 21 | BSD | |
| 905 | + | 22 | BTN | |
| 906 | + | 23 | BWP | |
| 907 | + | 24 | BYN | |
| 908 | + | 25 | BYR | |
| 909 | + | 26 | BZD | |
| 910 | + | 27 | CAD | |
| 911 | + | 28 | CDF | |
| 912 | + | 29 | CHE | |
| 913 | + | 30 | CHF | |
| 914 | + | 31 | CHW | |
| 915 | + | 32 | CLF | |
| 916 | + | 33 | CLP | |
| 917 | + | 34 | CNY | |
| 918 | + | 35 | COP | |
| 919 | + | 36 | COU | |
| 920 | + | 37 | CRC | |
| 921 | + | 38 | CUC | |
| 922 | + | 39 | CUP | |
| 923 | + | 40 | CVE | |
| 924 | + | 41 | CZK | |
| 925 | + | 42 | DJF | |
| 926 | + | 43 | DKK | |
| 927 | + | 44 | DOP | |
| 928 | + | 45 | DZD | |
| 929 | + | 46 | EGP | |
| 930 | + | 47 | ERN | |
| 931 | + | 48 | ETB | |
| 932 | + | 49 | EUR | |
| 933 | + | 50 | FJD | |
| 934 | + | 51 | FKP | |
| 935 | + | 52 | GBP | |
| 936 | + | 53 | GEL | |
| 937 | + | 54 | GHS | |
| 938 | + | 55 | GIP | |
| 939 | + | 56 | GMD | |
| 940 | + | 57 | GNF | |
| 941 | + | 58 | GTQ | |
| 942 | + | 59 | GYD | |
| 943 | + | 60 | HKD | |
| 944 | + | 61 | HNL | |
| 945 | + | 62 | HRK | |
| 946 | + | 63 | HTG | |
| 947 | + | 64 | HUF | |
| 948 | + | 65 | IDR | |
| 949 | + | 66 | ILS | |
| 950 | + | 67 | INR | |
| 951 | + | 68 | IQD | |
| 952 | + | 69 | IRR | |
| 953 | + | 70 | ISK | |
| 954 | + | 71 | JMD | |
| 955 | + | 72 | JOD | |
| 956 | + | 73 | JPY | |
| 957 | + | 74 | KES | |
| 958 | + | 75 | KGS | |
| 959 | + | 76 | KHR | |
| 960 | + | 77 | KMF | |
| 961 | + | 78 | KPW | |
| 962 | + | 79 | KRW | |
| 963 | + | 80 | KWD | |
| 964 | + | 81 | KYD | |
| 965 | + | 82 | KZT | |
| 966 | + | 83 | LAK | |
| 967 | + | 84 | LBP | |
| 968 | + | 85 | LKR | |
| 969 | + | 86 | LRD | |
| 970 | + | 87 | LSL | |
| 971 | + | 88 | LYD | |
| 972 | + | 89 | MAD | |
| 973 | + | 90 | MDL | |
| 974 | + | 91 | MGA | |
| 975 | + | 92 | MKD | |
| 976 | + | 93 | MMK | |
| 977 | + | 94 | MNT | |
| 978 | + | 95 | MOP | |
| 979 | + | 96 | MRO | |
| 980 | + | 97 | MUR | |
| 981 | + | 98 | MVR | |
| 982 | + | 99 | MWK | |
| 983 | + | 100 | MXN | |
| 984 | + | 101 | MXV | |
| 985 | + | 102 | MYR | |
| 986 | + | 103 | MZN | |
| 987 | + | 104 | NAD | |
| 988 | + | 105 | NGN | |
| 989 | + | 106 | NIO | |
| 990 | + | 107 | NOK | |
| 991 | + | 108 | NPR | |
| 992 | + | 109 | NZD | |
| 993 | + | 110 | OMR | |
| 994 | + | 111 | PAB | |
| 995 | + | 112 | PEN | |
| 996 | + | 113 | PGK | |
| 997 | + | 114 | PHP | |
| 998 | + | 115 | PKR | |
| 999 | + | 116 | PLN | |
| 1000 | + | 117 | PYG | |
| 1001 | + | 118 | QAR | |
| 1002 | + | 119 | RON | |
| 1003 | + | 120 | RSD | |
| 1004 | + | 121 | RUB | |
| 1005 | + | 122 | RWF | |
| 1006 | + | 123 | SAR | |
| 1007 | + | 124 | SBD | |
| 1008 | + | 125 | SCR | |
| 1009 | + | 126 | SDG | |
| 1010 | + | 127 | SEK | |
| 1011 | + | 128 | SGD | |
| 1012 | + | 129 | SHP | |
| 1013 | + | 130 | SLL | |
| 1014 | + | 131 | SOS | |
| 1015 | + | 132 | SRD | |
| 1016 | + | 133 | SSP | |
| 1017 | + | 134 | STD | |
| 1018 | + | 135 | SYP | |
| 1019 | + | 136 | SZL | |
| 1020 | + | 137 | THB | |
| 1021 | + | 138 | TJS | |
| 1022 | + | 139 | TMT | |
| 1023 | + | 140 | TND | |
| 1024 | + | 141 | TOP | |
| 1025 | + | 142 | TRY | |
| 1026 | + | 143 | TTD | |
| 1027 | + | 144 | TWD | |
| 1028 | + | 145 | TZS | |
| 1029 | + | 146 | UAH | |
| 1030 | + | 147 | UGX | |
| 1031 | + | 148 | USD | |
| 1032 | + | 149 | USN | |
| 1033 | + | 150 | UYI | |
| 1034 | + | 151 | UYU | |
| 1035 | + | 152 | UZS | |
| 1036 | + | 153 | VEF | |
| 1037 | + | 154 | VND | |
| 1038 | + | 155 | VUV | |
| 1039 | + | 156 | WST | |
| 1040 | + | 157 | XAF | |
| 1041 | + | 158 | XAG | |
| 1042 | + | 159 | XAU | |
| 1043 | + | 160 | XBA | |
| 1044 | + | 161 | XBB | |
| 1045 | + | 162 | XBC | |
| 1046 | + | 163 | XBD | |
| 1047 | + | 164 | XCD | |
| 1048 | + | 165 | XDR | |
| 1049 | + | 166 | XFU | |
| 1050 | + | 167 | XOF | |
| 1051 | + | 168 | XPD | |
| 1052 | + | 169 | XPF | |
| 1053 | + | 170 | XPT | |
| 1054 | + | 171 | XSU | |
| 1055 | + | 172 | XTS | |
| 1056 | + | 173 | XUA | |
| 1057 | + | 174 | XXX | |
| 1058 | + | 175 | YER | |
| 1059 | + | 176 | ZAR | |
| 1060 | + | 177 | ZMW | |
| 1061 | + |
797 | 1062 | - #### Compiling: Cordova Dependencies
|
798 | 1063 |
|
799 | 1064 | - Node
|
|
910 | 1175 |
|
911 | 1176 | ```xml
|
912 | 1177 | <!-- config.xml -->
|
913 |
| - <plugin name="branch-cordova-sdk" spec="^2.5.0" /> |
| 1178 | + <plugin name="branch-cordova-sdk" spec="^2.6.0" /> |
914 | 1179 | ```
|
915 | 1180 |
|
916 | 1181 | - #### Compiling: Incompatible Plugins
|
|
0 commit comments