|
1 | 1 | /* |
2 | 2 | * JavaScript tracker for Snowplow: tracker.js |
3 | | - * |
4 | | - * Significant portions copyright 2010 Anthon Pang. Remainder copyright |
| 3 | + * |
| 4 | + * Significant portions copyright 2010 Anthon Pang. Remainder copyright |
5 | 5 | * 2012-2016 Snowplow Analytics Ltd. All rights reserved. |
6 | | - * |
7 | | - * Redistribution and use in source and binary forms, with or without |
8 | | - * modification, are permitted provided that the following conditions are |
9 | | - * met: |
| 6 | + * |
| 7 | + * Redistribution and use in source and binary forms, with or without |
| 8 | + * modification, are permitted provided that the following conditions are |
| 9 | + * met: |
10 | 10 | * |
11 | 11 | * * Redistributions of source code must retain the above copyright |
12 | 12 | * notice, this list of conditions and the following disclaimer. |
|
476 | 476 | * Cookie getter. |
477 | 477 | */ |
478 | 478 | function getSnowplowCookieValue(cookieName) { |
| 479 | + var fullName = getSnowplowCookieName(cookieName); |
479 | 480 | if (configStateStorageStrategy == 'localStorage') { |
480 | | - return helpers.attemptGetLocalStorage(cookieName); |
| 481 | + return helpers.attemptGetLocalStorage(fullName); |
481 | 482 | } else if (configStateStorageStrategy == 'cookie' || |
482 | 483 | configStateStorageStrategy == 'cookieAndLocalStorage') { |
483 | | - return cookie.cookie(getSnowplowCookieName(cookieName)); |
| 484 | + return cookie.cookie(fullName); |
484 | 485 | } |
485 | 486 | } |
486 | 487 |
|
|
795 | 796 | function asCollectorUrl(rawUrl) { |
796 | 797 | if (forceSecureTracker) { |
797 | 798 | return ('https' + '://' + rawUrl); |
798 | | - } |
| 799 | + } |
799 | 800 | if (forceUnsecureTracker) { |
800 | 801 | return ('http' + '://' + rawUrl); |
801 | | - } |
| 802 | + } |
802 | 803 | return ('https:' === documentAlias.location.protocol ? 'https' : 'http') + '://' + rawUrl; |
803 | 804 | } |
804 | 805 |
|
|
891 | 892 | combinedContexts.push(augurIdentityLiteContext); |
892 | 893 | } |
893 | 894 | } |
894 | | - |
| 895 | + |
895 | 896 | //Add Parrable Context |
896 | 897 | if (autoContexts.parrable) { |
897 | 898 | var parrableContext = getParrableContext(); |
|
944 | 945 | */ |
945 | 946 | function getPerformanceTimingContext() { |
946 | 947 | var allowedKeys = [ |
947 | | - 'navigationStart', 'redirectStart', 'redirectEnd', 'fetchStart', 'domainLookupStart', 'domainLookupEnd', 'connectStart', |
| 948 | + 'navigationStart', 'redirectStart', 'redirectEnd', 'fetchStart', 'domainLookupStart', 'domainLookupEnd', 'connectStart', |
948 | 949 | 'secureConnectionStart', 'connectEnd', 'requestStart', 'responseStart', 'responseEnd', 'unloadEventStart', 'unloadEventEnd', |
949 | | - 'domLoading', 'domInteractive', 'domContentLoadedEventStart', 'domContentLoadedEventEnd', 'domComplete', 'loadEventStart', |
| 950 | + 'domLoading', 'domInteractive', 'domContentLoadedEventStart', 'domContentLoadedEventEnd', 'domComplete', 'loadEventStart', |
950 | 951 | 'loadEventEnd', 'msFirstPaint', 'chromeFirstPaint', 'requestEnd', 'proxyStart', 'proxyEnd' |
951 | 952 | ]; |
952 | 953 | var performance = windowAlias.performance || windowAlias.mozPerformance || windowAlias.msPerformance || windowAlias.webkitPerformance; |
|
1013 | 1014 |
|
1014 | 1015 | /** |
1015 | 1016 | * Get data for Optimizely "lite" contexts - active experiments on current page |
1016 | | - * |
| 1017 | + * |
1017 | 1018 | * @returns Array content of lite optimizely lite context |
1018 | 1019 | */ |
1019 | 1020 | function getOptimizelySummary() { |
|
1035 | 1036 |
|
1036 | 1037 | /** |
1037 | 1038 | * Get data for OptimizelyX contexts - active experiments on current page |
1038 | | - * |
| 1039 | + * |
1039 | 1040 | * @returns Array content of lite optimizely lite context |
1040 | 1041 | */ |
1041 | 1042 | function getOptimizelyXSummary() { |
|
1458 | 1459 | purify(customReferrer || configReferrerUrl), |
1459 | 1460 | addCommonContexts(finalizeContexts(context, contextCallback)), |
1460 | 1461 | tstamp); |
1461 | | - |
| 1462 | + |
1462 | 1463 | // Send ping (to log that user has stayed on page) |
1463 | 1464 | var now = new Date(); |
1464 | 1465 | if (activityTrackingEnabled && !activityTrackingInstalled) { |
|
0 commit comments