fork(1) download
  1. <?php
  2.  
  3. $trackingSolutionConfigurations = array (
  4. TRACKING_SERVICE_UNKNOWN => array (
  5. 'name' => 'Unknown',
  6. 'active' => false,
  7. 'clickPhase' => array (
  8. 's2s' => false,
  9. ),
  10. 'completionPhase' => array (
  11. 's2s' => false,
  12. )
  13. ),
  14. TRACKING_SERVICE_S2S => array (
  15. 'name' => 'Server2Server',
  16. 'active' => true,
  17. 'regex' => '/.*/',
  18. 'regexDynamicKey' => 'dynamicParameterSyntax',
  19. 'clickPhase' => array (
  20. 's2s' => false,
  21. ),
  22. 'completionPhase' => array (
  23. 's2s' => true,
  24. )
  25. ),
  26. TRACKING_SERVICE_SUPERSONIC_SDK => array (
  27. 'name' => 'Supersonic Tracking SDK',
  28. 'active' => true,
  29. 'notManaged' => true,
  30. 'clickPhase' => array (
  31. 's2s' => false,
  32. ),
  33. 'completionPhase' => array (
  34. 's2s' => false,
  35. )
  36. ),
  37. TRACKING_SERVICE_PIXEL => array (
  38. 'name' => 'Pixel Tracking',
  39. 'active' => false,
  40. 'clickPhase' => array (
  41. 's2s' => false,
  42. ),
  43. 'completionPhase' => array (
  44. 's2s' => false,
  45. )
  46. ),
  47. TRACKING_SERVICE_AD_EVEN => array( // Adjust
  48. 'name' => 'AdEven/adjust.io',
  49. 'active' => true,
  50. 'regex' => '/^http[s]?:\/\/app\.adjust\.(io|com)\/.*$/', // if you make changes in this regex, note that changes may be required in the sanitization of this url
  51. 'clickPhase' => array (
  52. 's2s' => true,
  53. 'params' => '&idfa={idfa}&gps_adid={aid}&s2s=1',
  54. ),
  55. 'completionPhase' => array (
  56. 's2s' => true,
  57. )
  58. ),
  59. TRACKING_SERVICE_AD_X => array(
  60. 'name' => 'Ad-X',
  61. 'active' => true,
  62. 'regex' => '/^http[s]?:\/\/ad-x\.co\.uk\/API\/click\/.*\/NET\/{DynamicParameter}___[0-9]*\/SupersonicAds\?.*$/', //'/^http[s]?:\/\/ad-x\.co\.uk\/API\/click.*$/'
  63. 'regexDynamicKey' => 'id',
  64. 'clickPhase' => array (
  65. 's2s' => true,
  66. 'params' => '&redirect=off&ipaddress={ip}',
  67. 'deliveryToggle' => true, // temp configuration
  68. ),
  69. 'completionPhase' => array (
  70. 's2s' => true,
  71. )
  72. ),
  73. TRACKING_SERVICE_APPS_FLYER => array(
  74. 'name' => 'AppsFlyer',
  75. 'active' => true,
  76. 'regex' => '/^(?=.*\bclickid={DynamicParameter}(&|$))(?=.*\bpid=supersonicads_int(&|$))http[s]?:\/\/app\.appsflyer\.com\/[^?]+\?(?:[^&]+)(?:&[^&]+)*$/',
  77. 'clickPhase' => array (
  78. 's2s' => true,
  79. 'params' => '&redirect=false&idfa={idfa}&advertising_id={aid}&af_cost_model={CostModel}&af_cost_value={CostModelValue}&af_cost_currency=USD',
  80. ),
  81. 'completionPhase' => array (
  82. 's2s' => true,
  83. '2ndCallbackParams' => array('app_id' => '','authentication' => ''), // Publisher perspective
  84. )
  85. ),
  86. TRACKING_SERVICE_AP_SALAR => array(
  87. 'name' => 'ApSalar',
  88. 'active' => false,
  89. 'regex' => '/^http[s]?:\/\/ad\.apsalar\.com\/api\/v1\/.*$/',
  90. 'clickPhase' => array (
  91. 's2s' => true,
  92. 'params' => '&redirect=false',
  93. 'deliveryToggle' => true, // temp configuration
  94. ),
  95. 'completionPhase' => array (
  96. 's2s' => true,
  97. )
  98. ),
  99. TRACKING_SERVICE_BBB => array(
  100. 'name' => 'BigBlueBubble',
  101. 'active' => false,
  102. 'regex' => '/^http[s]?:\/\/ua\.bbbgame\.net\/api\/msm\/track\?event=click.*$/',
  103. 'clickPhase' => array (
  104. 's2s' => true,
  105. 'params' => '&redirect=0',
  106. 'deliveryToggle' => true, // temp configuration
  107. ),
  108. 'completionPhase' => array (
  109. 's2s' => true,
  110. )
  111. ),
  112. TRACKING_SERVICE_KOCHAVA => array(
  113. 'name' => 'Kochava',
  114. 'active' => true,
  115. 'regex' => '/^http[s]?:\/\/control\.kochava\.com\/[^?]+\?(([^&]+)&)*click_id={DynamicParameter}(&([^&]+))*$/',
  116. 'clickPhase' => array (
  117. 's2s' => true,
  118. 'params' => '&pbr=1&device_ua={ua}&ip_address={ip}',
  119. 'deliveryToggle' => true, // temp configuration
  120. ),
  121. 'completionPhase' => array (
  122. 's2s' => true,
  123. )
  124. ),
  125. TRACKING_SERVICE_TAP_STREAM => array(
  126. 'name' => 'Tapstream',
  127. 'active' => false,
  128. 'regex' => '/^http[s]?:\/\/(api\.)?taps\.io\/.*$/',
  129. 'clickPhase' => array (
  130. 's2s' => true,
  131. 'params' => '&__tsip={ip}&__tsredirect=0&__tshardware-android-advertising-id={aid}',
  132. 'deliveryToggle' => true, // temp configuration
  133. ),
  134. 'completionPhase' => array (
  135. 's2s' => true,
  136. ),
  137. ),
  138. TRACKING_SERVICE_TENJIN => array(
  139. 'name' => 'Tenjin',
  140. 'active' => true,
  141. 'regex' => '/^https:\/\/track\.tenjin\.io.+click\/[^?]*\?(([^&]+)&)*((remote_click_id={DynamicParameter}&(([^&]+)&)*advertising_id={DeviceIds\[(IFA|AID)\]})|(advertising_id={DeviceIds\[(IFA|AID)\]}&(([^&]+)&)*remote_click_id={DynamicParameter}))/',
  142. 'clickPhase' => array (
  143. 's2s' => false,
  144. ),
  145. 'completionPhase' => array (
  146. 's2s' => true,
  147. )
  148. ),
  149. TRACKING_SERVICE_TUNE => array( // Tune
  150. 'name' => 'Tune',
  151. 'active' => true,
  152. 'regex' => '/^(?=.*\baction=click(&|$))(?=.*\bpublisher_id=[\d]+(&|$))(?=.*\bsite_id=[\d]+(&|$))(?=.*\bref_id={DynamicParameter}(&|$))http[s]?:\/\/(?:(?:[\d]+\.api-[\d]{2})|(?:hastrk[\d]+)|(?:[\d]+\.measurementapi))\.com\/serve\?(?:[^&]+)(?:&[^&]+)*$/',
  153. 'impressionPhase' => array (
  154. 'params' => '&device_ip={ip}&response_format=json',
  155. ),
  156. 'clickPhase' => array (
  157. 's2s' => true,
  158. 'params' => '&google_aid={aid}&ios_ifa={ifa}&device_ip={ip}&response_format=json',
  159. 'useEncryption' => true, // Because encryption is on - no CostModel place holders
  160. ),
  161. 'completionPhase' => array (
  162. 's2s' => true,
  163. ),
  164. ),
  165. );
  166.  
  167.  
  168. $trackingServices = $trackingSolutionConfigurations;
  169. $inactiveTrackingServices = array();
  170.  
  171. foreach ($trackingServices as $serviceId => &$serviceData) {
  172. // Only when a tracking service is not managed by advertiser, the flag is being checked
  173. $managedAdvertiserLogic = !isset($serviceData['notManaged']) ? true :
  174. !true && $serviceData['notManaged'];
  175.  
  176. $isActiveTracking = $serviceData['active'] && $managedAdvertiserLogic;
  177. $serviceData['id'] = $serviceId;
  178. unset($serviceData['active']);
  179. unset($serviceData['notManaged']);
  180.  
  181. if (!$isActiveTracking){
  182. unset($trackingServices[$serviceId]);
  183. $inactiveTrackingServices[$serviceId] = $serviceData;
  184. }
  185. }
  186.  
  187. if ($onlyActive) {
  188. print_r($trackingServices);
  189. } else{
  190. print_r(array('trackingServices' => $trackingServices, 'inactiveTrackingServices' => $inactiveTrackingServices));
  191. }
  192.  
  193.  
  194.  
Success #stdin #stdout #stderr 0.01s 82880KB
stdin
Standard input is empty
stdout
Array
(
    [trackingServices] => Array
        (
            [TRACKING_SERVICE_S2S] => Array
                (
                    [name] => Server2Server
                    [regex] => /.*/
                    [regexDynamicKey] => dynamicParameterSyntax
                    [clickPhase] => Array
                        (
                            [s2s] => 
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_S2S
                )

            [TRACKING_SERVICE_AD_EVEN] => Array
                (
                    [name] => AdEven/adjust.io
                    [regex] => /^http[s]?:\/\/app\.adjust\.(io|com)\/.*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &idfa={idfa}&gps_adid={aid}&s2s=1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_AD_EVEN
                )

            [TRACKING_SERVICE_AD_X] => Array
                (
                    [name] => Ad-X
                    [regex] => /^http[s]?:\/\/ad-x\.co\.uk\/API\/click\/.*\/NET\/{DynamicParameter}___[0-9]*\/SupersonicAds\?.*$/
                    [regexDynamicKey] => id
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &redirect=off&ipaddress={ip}
                            [deliveryToggle] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_AD_X
                )

            [TRACKING_SERVICE_APPS_FLYER] => Array
                (
                    [name] => AppsFlyer
                    [regex] => /^(?=.*\bclickid={DynamicParameter}(&|$))(?=.*\bpid=supersonicads_int(&|$))http[s]?:\/\/app\.appsflyer\.com\/[^?]+\?(?:[^&]+)(?:&[^&]+)*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &redirect=false&idfa={idfa}&advertising_id={aid}&af_cost_model={CostModel}&af_cost_value={CostModelValue}&af_cost_currency=USD
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                            [2ndCallbackParams] => Array
                                (
                                    [app_id] => 
                                    [authentication] => 
                                )

                        )

                    [id] => TRACKING_SERVICE_APPS_FLYER
                )

            [TRACKING_SERVICE_KOCHAVA] => Array
                (
                    [name] => Kochava
                    [regex] => /^http[s]?:\/\/control\.kochava\.com\/[^?]+\?(([^&]+)&)*click_id={DynamicParameter}(&([^&]+))*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &pbr=1&device_ua={ua}&ip_address={ip}
                            [deliveryToggle] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_KOCHAVA
                )

            [TRACKING_SERVICE_TENJIN] => Array
                (
                    [name] => Tenjin
                    [regex] => /^https:\/\/track\.tenjin\.io.+click\/[^?]*\?(([^&]+)&)*((remote_click_id={DynamicParameter}&(([^&]+)&)*advertising_id={DeviceIds\[(IFA|AID)\]})|(advertising_id={DeviceIds\[(IFA|AID)\]}&(([^&]+)&)*remote_click_id={DynamicParameter}))/
                    [clickPhase] => Array
                        (
                            [s2s] => 
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_TENJIN
                )

            [TRACKING_SERVICE_TUNE] => Array
                (
                    [name] => Tune
                    [regex] => /^(?=.*\baction=click(&|$))(?=.*\bpublisher_id=[\d]+(&|$))(?=.*\bsite_id=[\d]+(&|$))(?=.*\bref_id={DynamicParameter}(&|$))http[s]?:\/\/(?:(?:[\d]+\.api-[\d]{2})|(?:hastrk[\d]+)|(?:[\d]+\.measurementapi))\.com\/serve\?(?:[^&]+)(?:&[^&]+)*$/
                    [impressionPhase] => Array
                        (
                            [params] => &device_ip={ip}&response_format=json
                        )

                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &google_aid={aid}&ios_ifa={ifa}&device_ip={ip}&response_format=json
                            [useEncryption] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_TUNE
                )

        )

    [inactiveTrackingServices] => Array
        (
            [TRACKING_SERVICE_UNKNOWN] => Array
                (
                    [name] => Unknown
                    [clickPhase] => Array
                        (
                            [s2s] => 
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 
                        )

                    [id] => TRACKING_SERVICE_UNKNOWN
                )

            [TRACKING_SERVICE_SUPERSONIC_SDK] => Array
                (
                    [name] => Supersonic Tracking SDK
                    [clickPhase] => Array
                        (
                            [s2s] => 
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 
                        )

                    [id] => TRACKING_SERVICE_SUPERSONIC_SDK
                )

            [TRACKING_SERVICE_PIXEL] => Array
                (
                    [name] => Pixel Tracking
                    [clickPhase] => Array
                        (
                            [s2s] => 
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 
                        )

                    [id] => TRACKING_SERVICE_PIXEL
                )

            [TRACKING_SERVICE_AP_SALAR] => Array
                (
                    [name] => ApSalar
                    [regex] => /^http[s]?:\/\/ad\.apsalar\.com\/api\/v1\/.*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &redirect=false
                            [deliveryToggle] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_AP_SALAR
                )

            [TRACKING_SERVICE_BBB] => Array
                (
                    [name] => BigBlueBubble
                    [regex] => /^http[s]?:\/\/ua\.bbbgame\.net\/api\/msm\/track\?event=click.*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &redirect=0
                            [deliveryToggle] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_BBB
                )

            [TRACKING_SERVICE_TAP_STREAM] => Array
                (
                    [name] => Tapstream
                    [regex] => /^http[s]?:\/\/(api\.)?taps\.io\/.*$/
                    [clickPhase] => Array
                        (
                            [s2s] => 1
                            [params] => &__tsip={ip}&__tsredirect=0&__tshardware-android-advertising-id={aid}
                            [deliveryToggle] => 1
                        )

                    [completionPhase] => Array
                        (
                            [s2s] => 1
                        )

                    [id] => TRACKING_SERVICE_TAP_STREAM
                )

        )

)
stderr
PHP Notice:  Use of undefined constant TRACKING_SERVICE_UNKNOWN - assumed 'TRACKING_SERVICE_UNKNOWN' in /home/xurGeW/prog.php on line 4
PHP Notice:  Use of undefined constant TRACKING_SERVICE_S2S - assumed 'TRACKING_SERVICE_S2S' in /home/xurGeW/prog.php on line 14
PHP Notice:  Use of undefined constant TRACKING_SERVICE_SUPERSONIC_SDK - assumed 'TRACKING_SERVICE_SUPERSONIC_SDK' in /home/xurGeW/prog.php on line 26
PHP Notice:  Use of undefined constant TRACKING_SERVICE_PIXEL - assumed 'TRACKING_SERVICE_PIXEL' in /home/xurGeW/prog.php on line 37
PHP Notice:  Use of undefined constant TRACKING_SERVICE_AD_EVEN - assumed 'TRACKING_SERVICE_AD_EVEN' in /home/xurGeW/prog.php on line 47
PHP Notice:  Use of undefined constant TRACKING_SERVICE_AD_X - assumed 'TRACKING_SERVICE_AD_X' in /home/xurGeW/prog.php on line 59
PHP Notice:  Use of undefined constant TRACKING_SERVICE_APPS_FLYER - assumed 'TRACKING_SERVICE_APPS_FLYER' in /home/xurGeW/prog.php on line 73
PHP Notice:  Use of undefined constant TRACKING_SERVICE_AP_SALAR - assumed 'TRACKING_SERVICE_AP_SALAR' in /home/xurGeW/prog.php on line 86
PHP Notice:  Use of undefined constant TRACKING_SERVICE_BBB - assumed 'TRACKING_SERVICE_BBB' in /home/xurGeW/prog.php on line 99
PHP Notice:  Use of undefined constant TRACKING_SERVICE_KOCHAVA - assumed 'TRACKING_SERVICE_KOCHAVA' in /home/xurGeW/prog.php on line 112
PHP Notice:  Use of undefined constant TRACKING_SERVICE_TAP_STREAM - assumed 'TRACKING_SERVICE_TAP_STREAM' in /home/xurGeW/prog.php on line 125
PHP Notice:  Use of undefined constant TRACKING_SERVICE_TENJIN - assumed 'TRACKING_SERVICE_TENJIN' in /home/xurGeW/prog.php on line 138
PHP Notice:  Use of undefined constant TRACKING_SERVICE_TUNE - assumed 'TRACKING_SERVICE_TUNE' in /home/xurGeW/prog.php on line 149
PHP Notice:  Undefined variable: onlyActive in /home/xurGeW/prog.php on line 187