{"action":"created","comment":{"url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/comments/106450163","pull_request_review_id":27371347,"id":106450163,"diff_hunk":"@@ -17,34 +20,44 @@ for(var i=0; i < length; i++){\n     }\n }\n \n-b[\"cescLastTouchTimeStamp\"] = lastTouchTimeStamp;\n-b[\"cescLastTouchMarketingCode\"] = lastTouchMarketingCode;\n+\n b[\"cescPriorTouchTimeStamp\"] = priorTimeStamp;\n b[\"cescPriorTouchMarketingCode\"] = priorMarketingCode;\n \n-\n-var dateDifference = parseInt((new Date() - new Date(lastTouchTimeStamp))/(1000*60*60*24));\n-if(dateDifference <= 30 && dateDifference >= 0) {\n-    b['cescLastTouch_isexpired'] = false;\n-}else {\n-    b['cescLastTouch_isexpired'] = true;\n-}\n-\n-if(lastTouchMarketingCode.split(\".\").length >= 4){\n-    b[\"cescChannel\"] = lastTouchMarketingCode.split(\".\")[0];\n-    b[\"cescCompany\"] = lastTouchMarketingCode.split(\".\")[1];\n-    b[\"cescCountry\"] = lastTouchMarketingCode.split(\".\")[2];\n-    b[\"cescNetwork\"] = lastTouchMarketingCode.split(\".\")[3];\n-}\n-\n-\n var fullMarketingCode = lastTouchMarketingCode;\n var patrialMarketingCode = b[\"context.marketingAttribution.campaignId\"];\n \n+b[\"cescDTL\"] = \"\";\n if(fullMarketingCode != undefined && patrialMarketingCode != undefined && fullMarketingCode.indexOf(patrialMarketingCode) > -1 ){\n     var marketingCodeAndDTL = fullMarketingCode.split(patrialMarketingCode + \".\");\n     if( marketingCodeAndDTL.length >= 2 ){\n         b[\"cescDTL\"]  = marketingCodeAndDTL[1];\n-        b[\"cescLastTouchMarketingCode\"] = patrialMarketingCode;     //This is to handle the case where there is DTL in the lastTouchMarketingCode.\n     }\n }\n+\n+\n+// Use CID for last touch\n+\n+b[\"cescLastTouchTimeStamp\"] = b[\"context.marketingAttribution.campaignIdTimestamp\"];\n+b[\"cescLastTouchMarketingCode\"] = b[\"context.marketingAttribution.campaignId\"];\n+var dateDifference = parseInt((new Date() - new Date(b[\"cescLastTouchTimeStamp\"]))/(1000*60*60*24));\n+\n+b['cescLastTouch_isexpired'] = \"\";\n+if(dateDifference <= 30 && dateDifference >= 0) {\n+    b['cescLastTouch_isexpired'] = false;\n+}else {\n+    b['cescLastTouch_isexpired'] = true;\n+}\n+\n+// Load rule looks for country and network, and if these are undefined in the udo the load rule will break and tag will not fire even it other conditions are met.\n+// Therefore, initializing it to empty so load rule doesn't break.\n+b[\"cescChannel\"] = \"\";\n+b[\"cescCompany\"] = \"\";\n+b[\"cescCountry\"] = \"\";\n+b[\"cescNetwork\"] = \"\";\n+if(b[\"cescLastTouchMarketingCode\"].split(\".\").length >= 4){\n+    b[\"cescChannel\"] = b[\"cescLastTouchMarketingCode\"].split(\".\")[0];","path":"src/library/simplified/extension/cesc-LT-channel-country-network-DTL.js","position":69,"original_position":69,"commit_id":"31dcfb43fe881d8bc2aa43a4849e397131eeb123","original_commit_id":"31dcfb43fe881d8bc2aa43a4849e397131eeb123","user":{"login":"wmoussa","id":5693735,"avatar_url":"https://avatars1.githubusercontent.com/u/5693735?v=3","gravatar_id":"","url":"https://api.github.com/users/wmoussa","html_url":"https://github.com/wmoussa","followers_url":"https://api.github.com/users/wmoussa/followers","following_url":"https://api.github.com/users/wmoussa/following{/other_user}","gists_url":"https://api.github.com/users/wmoussa/gists{/gist_id}","starred_url":"https://api.github.com/users/wmoussa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmoussa/subscriptions","organizations_url":"https://api.github.com/users/wmoussa/orgs","repos_url":"https://api.github.com/users/wmoussa/repos","events_url":"https://api.github.com/users/wmoussa/events{/privacy}","received_events_url":"https://api.github.com/users/wmoussa/received_events","type":"User","site_admin":false},"body":"you should just prepare the array once, instead of splitting each time","created_at":"2017-03-16T15:32:27Z","updated_at":"2017-03-16T15:33:34Z","html_url":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82#discussion_r106450163","pull_request_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82","_links":{"self":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/comments/106450163"},"html":{"href":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82#discussion_r106450163"},"pull_request":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82","id":110991137,"html_url":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82","diff_url":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82.diff","patch_url":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82.patch","issue_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/82","number":82,"state":"open","locked":false,"title":"fix undefined fields for cesc","user":{"login":"trungnguyenexp","id":23199197,"avatar_url":"https://avatars3.githubusercontent.com/u/23199197?v=3","gravatar_id":"","url":"https://api.github.com/users/trungnguyenexp","html_url":"https://github.com/trungnguyenexp","followers_url":"https://api.github.com/users/trungnguyenexp/followers","following_url":"https://api.github.com/users/trungnguyenexp/following{/other_user}","gists_url":"https://api.github.com/users/trungnguyenexp/gists{/gist_id}","starred_url":"https://api.github.com/users/trungnguyenexp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trungnguyenexp/subscriptions","organizations_url":"https://api.github.com/users/trungnguyenexp/orgs","repos_url":"https://api.github.com/users/trungnguyenexp/repos","events_url":"https://api.github.com/users/trungnguyenexp/events{/privacy}","received_events_url":"https://api.github.com/users/trungnguyenexp/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-16T04:22:06Z","updated_at":"2017-03-16T15:33:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d3f616a722f7aaf94f1228f7114977463d941c4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82/commits","review_comments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82/comments","review_comment_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/82/comments","statuses_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/statuses/31dcfb43fe881d8bc2aa43a4849e397131eeb123","head":{"label":"ExpediaInc:trungn","ref":"trungn","sha":"31dcfb43fe881d8bc2aa43a4849e397131eeb123","user":{"login":"ExpediaInc","id":1225964,"avatar_url":"https://avatars1.githubusercontent.com/u/1225964?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpediaInc","html_url":"https://github.com/ExpediaInc","followers_url":"https://api.github.com/users/ExpediaInc/followers","following_url":"https://api.github.com/users/ExpediaInc/following{/other_user}","gists_url":"https://api.github.com/users/ExpediaInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpediaInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpediaInc/subscriptions","organizations_url":"https://api.github.com/users/ExpediaInc/orgs","repos_url":"https://api.github.com/users/ExpediaInc/repos","events_url":"https://api.github.com/users/ExpediaInc/events{/privacy}","received_events_url":"https://api.github.com/users/ExpediaInc/received_events","type":"Organization","site_admin":false},"repo":{"id":71837401,"name":"expedia-omg-tags","full_name":"ExpediaInc/expedia-omg-tags","owner":{"login":"ExpediaInc","id":1225964,"avatar_url":"https://avatars1.githubusercontent.com/u/1225964?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpediaInc","html_url":"https://github.com/ExpediaInc","followers_url":"https://api.github.com/users/ExpediaInc/followers","following_url":"https://api.github.com/users/ExpediaInc/following{/other_user}","gists_url":"https://api.github.com/users/ExpediaInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpediaInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpediaInc/subscriptions","organizations_url":"https://api.github.com/users/ExpediaInc/orgs","repos_url":"https://api.github.com/users/ExpediaInc/repos","events_url":"https://api.github.com/users/ExpediaInc/events{/privacy}","received_events_url":"https://api.github.com/users/ExpediaInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ExpediaInc/expedia-omg-tags","description":null,"fork":false,"url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags","forks_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/forks","keys_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/teams","hooks_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/hooks","issue_events_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/events{/number}","events_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/events","assignees_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/assignees{/user}","branches_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/branches{/branch}","tags_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/tags","blobs_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/statuses/{sha}","languages_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/languages","stargazers_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/stargazers","contributors_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/contributors","subscribers_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/subscribers","subscription_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/subscription","commits_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/contents/{+path}","compare_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/merges","archive_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/downloads","issues_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues{/number}","pulls_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls{/number}","milestones_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/milestones{/number}","notifications_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/labels{/name}","releases_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/releases{/id}","deployments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/deployments","created_at":"2016-10-24T22:28:42Z","updated_at":"2016-11-01T17:33:40Z","pushed_at":"2017-03-16T04:22:07Z","git_url":"git://github.com/ExpediaInc/expedia-omg-tags.git","ssh_url":"git@github.com:ExpediaInc/expedia-omg-tags.git","clone_url":"https://github.com/ExpediaInc/expedia-omg-tags.git","svn_url":"https://github.com/ExpediaInc/expedia-omg-tags","homepage":null,"size":212,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":4,"forks":8,"open_issues":4,"watchers":2,"default_branch":"master"}},"base":{"label":"ExpediaInc:master","ref":"master","sha":"9b0ce3179870dfbf10fde3feca4e34e2612b5b73","user":{"login":"ExpediaInc","id":1225964,"avatar_url":"https://avatars1.githubusercontent.com/u/1225964?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpediaInc","html_url":"https://github.com/ExpediaInc","followers_url":"https://api.github.com/users/ExpediaInc/followers","following_url":"https://api.github.com/users/ExpediaInc/following{/other_user}","gists_url":"https://api.github.com/users/ExpediaInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpediaInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpediaInc/subscriptions","organizations_url":"https://api.github.com/users/ExpediaInc/orgs","repos_url":"https://api.github.com/users/ExpediaInc/repos","events_url":"https://api.github.com/users/ExpediaInc/events{/privacy}","received_events_url":"https://api.github.com/users/ExpediaInc/received_events","type":"Organization","site_admin":false},"repo":{"id":71837401,"name":"expedia-omg-tags","full_name":"ExpediaInc/expedia-omg-tags","owner":{"login":"ExpediaInc","id":1225964,"avatar_url":"https://avatars1.githubusercontent.com/u/1225964?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpediaInc","html_url":"https://github.com/ExpediaInc","followers_url":"https://api.github.com/users/ExpediaInc/followers","following_url":"https://api.github.com/users/ExpediaInc/following{/other_user}","gists_url":"https://api.github.com/users/ExpediaInc/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpediaInc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpediaInc/subscriptions","organizations_url":"https://api.github.com/users/ExpediaInc/orgs","repos_url":"https://api.github.com/users/ExpediaInc/repos","events_url":"https://api.github.com/users/ExpediaInc/events{/privacy}","received_events_url":"https://api.github.com/users/ExpediaInc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ExpediaInc/expedia-omg-tags","description":null,"fork":false,"url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags","forks_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/forks","keys_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/teams","hooks_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/hooks","issue_events_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/events{/number}","events_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/events","assignees_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/assignees{/user}","branches_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/branches{/branch}","tags_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/tags","blobs_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/statuses/{sha}","languages_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/languages","stargazers_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/stargazers","contributors_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/contributors","subscribers_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/subscribers","subscription_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/subscription","commits_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/contents/{+path}","compare_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/merges","archive_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/downloads","issues_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues{/number}","pulls_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls{/number}","milestones_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/milestones{/number}","notifications_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/labels{/name}","releases_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/releases{/id}","deployments_url":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/deployments","created_at":"2016-10-24T22:28:42Z","updated_at":"2016-11-01T17:33:40Z","pushed_at":"2017-03-16T04:22:07Z","git_url":"git://github.com/ExpediaInc/expedia-omg-tags.git","ssh_url":"git@github.com:ExpediaInc/expedia-omg-tags.git","clone_url":"https://github.com/ExpediaInc/expedia-omg-tags.git","svn_url":"https://github.com/ExpediaInc/expedia-omg-tags","homepage":null,"size":212,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":4,"forks":8,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82"},"html":{"href":"https://github.com/ExpediaInc/expedia-omg-tags/pull/82"},"issue":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/82"},"comments":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/ExpediaInc/expedia-omg-tags/statuses/31dcfb43fe881d8bc2aa43a4849e397131eeb123"}}}}
{"actor":{"display_login":"wmoussa"}}