|
76 | 76 | * 12. useCookies, true |
77 | 77 | * 13. sessionCookieTimeout, 1800 |
78 | 78 | * 14. contexts, {} |
79 | | - * 15. beacon, false |
80 | | - * 16. post, false |
81 | | - * 17. bufferSize, 1 |
82 | | - * 18. crossDomainLinker, false |
83 | | - * 19. maxPostBytes, 40000 |
84 | | - * 20. discoverRootDomain, false |
85 | | - * 21. cookieLifetime, 63072000 |
86 | | - * 22. stateStorageStrategy, 'cookieAndLocalStorage' |
| 79 | + * 15. eventMethod, 'beacon' |
| 80 | + * 16. post, false *DEPRECATED use eventMethod instead* |
| 81 | + * 17. postPath, null |
| 82 | + * 18. bufferSize, 1 |
| 83 | + * 19. crossDomainLinker, false |
| 84 | + * 20. maxPostBytes, 40000 |
| 85 | + * 21. discoverRootDomain, false |
| 86 | + * 22. cookieLifetime, 63072000 |
| 87 | + * 23. stateStorageStrategy, 'cookieAndLocalStorage' |
87 | 88 | */ |
88 | 89 | object.Tracker = function Tracker(functionName, namespace, version, mutSnowplowState, argmap) { |
89 | 90 |
|
90 | 91 | /************************************************************ |
91 | 92 | * Private members |
92 | 93 | ************************************************************/ |
93 | | - var |
| 94 | + |
| 95 | + var argmap = argmap || {}; |
| 96 | + |
| 97 | + //use POST if that property is present on the argmap |
| 98 | + if(argmap.hasOwnProperty('post')) { |
| 99 | + argmap.eventMethod = argmap.post === true ? 'post' : 'get'; |
| 100 | + } else { |
| 101 | + argmap.eventMethod = argmap.eventMethod || 'beacon' |
| 102 | + } |
| 103 | + |
| 104 | + var |
94 | 105 | // Tracker core |
95 | 106 | core = coreConstructor(true, function(payload) { |
96 | 107 | addBrowserData(payload); |
|
127 | 138 |
|
128 | 139 | customReferrer, |
129 | 140 |
|
130 | | - argmap = argmap || {}, |
131 | | - |
132 | 141 | // Request method is always GET for Snowplow |
133 | 142 | configRequestMethod = 'GET', |
134 | 143 |
|
|
297 | 306 | mutSnowplowState, |
298 | 307 | configStateStorageStrategy == 'localStorage' || |
299 | 308 | configStateStorageStrategy == 'cookieAndLocalStorage', |
300 | | - argmap.beacon, |
301 | | - argmap.post, |
| 309 | + argmap.eventMethod, |
302 | 310 | configPostPath, |
303 | 311 | argmap.bufferSize, |
304 | 312 | argmap.maxPostBytes || 40000), |
|
0 commit comments