{"action":"created","issue":{"url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/24","labels_url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/24/comments","events_url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/24/events","html_url":"https://github.com/PrestaShop/ganalytics/pull/24","id":53773412,"number":24,"title":"[-] MO ganalytics: id_product missing in product page","user":{"login":"kermes","id":7022112,"avatar_url":"https://avatars.githubusercontent.com/u/7022112?v=3","gravatar_id":"","url":"https://api.github.com/users/kermes","html_url":"https://github.com/kermes","followers_url":"https://api.github.com/users/kermes/followers","following_url":"https://api.github.com/users/kermes/following{/other_user}","gists_url":"https://api.github.com/users/kermes/gists{/gist_id}","starred_url":"https://api.github.com/users/kermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kermes/subscriptions","organizations_url":"https://api.github.com/users/kermes/orgs","repos_url":"https://api.github.com/users/kermes/repos","events_url":"https://api.github.com/users/kermes/events{/privacy}","received_events_url":"https://api.github.com/users/kermes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-08T16:57:24Z","updated_at":"2015-01-13T10:50:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PrestaShop/ganalytics/pulls/24","html_url":"https://github.com/PrestaShop/ganalytics/pull/24","diff_url":"https://github.com/PrestaShop/ganalytics/pull/24.diff","patch_url":"https://github.com/PrestaShop/ganalytics/pull/24.patch"},"body":"sometimes referece is not set and id_product is not set either"},"comment":{"url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/comments/69726931","html_url":"https://github.com/PrestaShop/ganalytics/pull/24#issuecomment-69726931","issue_url":"https://api.github.com/repos/PrestaShop/ganalytics/issues/24","id":69726931,"user":{"login":"Quetzacoalt91","id":6768917,"avatar_url":"https://avatars.githubusercontent.com/u/6768917?v=3","gravatar_id":"","url":"https://api.github.com/users/Quetzacoalt91","html_url":"https://github.com/Quetzacoalt91","followers_url":"https://api.github.com/users/Quetzacoalt91/followers","following_url":"https://api.github.com/users/Quetzacoalt91/following{/other_user}","gists_url":"https://api.github.com/users/Quetzacoalt91/gists{/gist_id}","starred_url":"https://api.github.com/users/Quetzacoalt91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quetzacoalt91/subscriptions","organizations_url":"https://api.github.com/users/Quetzacoalt91/orgs","repos_url":"https://api.github.com/users/Quetzacoalt91/repos","events_url":"https://api.github.com/users/Quetzacoalt91/events{/privacy}","received_events_url":"https://api.github.com/users/Quetzacoalt91/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T10:50:35Z","updated_at":"2015-01-13T10:50:35Z","body":"You are right, the ID was on the bottom of my attributes list.\r\n\r\nSo if we have the ID too, I wonder if we should not do the test directly inside ```wrapProduct(...)``` with something like this:\r\n```php\r\n\tpublic function wrapProduct($product, $extras, $index = 0, $full = false)\r\n\t{\r\n\t\t[...]\r\n\r\n\t\t$product_id = 0;\r\n\t\tif (!empty($product['reference']))\r\n\t\t\t$product_id = $product['reference'];\r\n\t\telse if (!empty($product['id_product']))\r\n\t\t\t$product_id = $product['id_product'];\r\n\t\telse if (!empty($product['id']))\r\n\t\t\t$product_id = $product['id'];\r\n\r\n\t\t[...]\r\n\r\n\t\t\t$ga_product = array(\r\n\t\t\t\t'id' => $product_id,\r\n```\r\n\r\nThe fix could be available for every call of wrapProduct."}}