{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/frontend/issues/12957","repository_url":"https://api.github.com/repos/guardian/frontend","labels_url":"https://api.github.com/repos/guardian/frontend/issues/12957/labels{/name}","comments_url":"https://api.github.com/repos/guardian/frontend/issues/12957/comments","events_url":"https://api.github.com/repos/guardian/frontend/issues/12957/events","html_url":"https://github.com/guardian/frontend/pull/12957","id":155469164,"number":12957,"title":"Fix Page Skins not being rendered when they should be","user":{"login":"JonNorman","id":1821099,"avatar_url":"https://avatars.githubusercontent.com/u/1821099?v=3","gravatar_id":"","url":"https://api.github.com/users/JonNorman","html_url":"https://github.com/JonNorman","followers_url":"https://api.github.com/users/JonNorman/followers","following_url":"https://api.github.com/users/JonNorman/following{/other_user}","gists_url":"https://api.github.com/users/JonNorman/gists{/gist_id}","starred_url":"https://api.github.com/users/JonNorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonNorman/subscriptions","organizations_url":"https://api.github.com/users/JonNorman/orgs","repos_url":"https://api.github.com/users/JonNorman/repos","events_url":"https://api.github.com/users/JonNorman/events{/privacy}","received_events_url":"https://api.github.com/users/JonNorman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-18T10:37:07Z","updated_at":"2016-05-18T12:52:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/guardian/frontend/pulls/12957","html_url":"https://github.com/guardian/frontend/pull/12957","diff_url":"https://github.com/guardian/frontend/pull/12957.diff","patch_url":"https://github.com/guardian/frontend/pull/12957.patch"},"body":"## How we determine whether to render a Page Skin\r\nIn order to determine whether a page has a Page Skin, we look at the `PageSkinSponsorship`s that we have; we look for the **first** `PageSkinSponsorship` that matches the Ad Unit and Edition of the page. We then check to see whether we are running in production and whether this `PageSkinSponsorship` is behind a test cookie.\r\n\r\n## The problem\r\nWhen we have multiple Page Skin sponsorships for the same Ad Unit (some behind Ad Tests, some not), then if we only look at the first matching Ad Test, we may end up inspecting the Ad Test sponsorship with the test cookie, rather than the pure, puckka production-ready sponsorship, and falsely concluding that we shouldn't render a Page Skin on this page.\r\n\r\n## The fix\r\nJust look at all the `PageSkinSponsorship`s instead of the first one that matches our page criteria.\r\n \r\n## What is the value of this and can you measure success?\r\nPage Skins should work again.\r\n\r\n## Does this affect other platforms - Amp, Apps, etc?\r\nNo.\r\n"},"comment":{"url":"https://api.github.com/repos/guardian/frontend/issues/comments/220016340","html_url":"https://github.com/guardian/frontend/pull/12957#issuecomment-220016340","issue_url":"https://api.github.com/repos/guardian/frontend/issues/12957","id":220016340,"user":{"login":"jbreckmckye","id":3148617,"avatar_url":"https://avatars.githubusercontent.com/u/3148617?v=3","gravatar_id":"","url":"https://api.github.com/users/jbreckmckye","html_url":"https://github.com/jbreckmckye","followers_url":"https://api.github.com/users/jbreckmckye/followers","following_url":"https://api.github.com/users/jbreckmckye/following{/other_user}","gists_url":"https://api.github.com/users/jbreckmckye/gists{/gist_id}","starred_url":"https://api.github.com/users/jbreckmckye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbreckmckye/subscriptions","organizations_url":"https://api.github.com/users/jbreckmckye/orgs","repos_url":"https://api.github.com/users/jbreckmckye/repos","events_url":"https://api.github.com/users/jbreckmckye/events{/privacy}","received_events_url":"https://api.github.com/users/jbreckmckye/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T12:52:03Z","updated_at":"2016-05-18T12:52:03Z","body":"Cool 👍 "}}