{"id":21496523,"url":"https://github.com/mlibrary/readership-map","last_synced_at":"2026-01-03T19:13:33.941Z","repository":{"id":37530789,"uuid":"207365496","full_name":"mlibrary/readership-map","owner":"mlibrary","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-30T18:55:29.000Z","size":1432,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-23T21:53:21.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-09T17:28:00.000Z","updated_at":"2024-08-30T18:55:33.000Z","dependencies_parsed_at":"2024-04-19T01:32:48.411Z","dependency_job_id":"98abc062-31a1-4d51-9c5e-3fc38f8790dc","html_url":"https://github.com/mlibrary/readership-map","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Freadership-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Freadership-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Freadership-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlibrary%2Freadership-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlibrary","download_url":"https://codeload.github.com/mlibrary/readership-map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031154,"owners_count":20386534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T16:16:53.797Z","updated_at":"2026-01-03T19:13:28.905Z","avatar_url":"https://github.com/mlibrary.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Readership map\n\n[![Build Status Badge](https://api.travis-ci.org/mlibrary/readership-map.svg?branch=master)](https://travis-ci.org/mlibrary/readership-map)\n[![Coverage Status](https://coveralls.io/repos/github/mlibrary/readership-map/badge.svg?branch=master)](https://coveralls.io/github/mlibrary/readership-map?branch=master)\n\n## Setup (not quite there yet for full real-time)\n\n1. git clone https://github.com/mlibrary/readership-map\n2. cd readership-map\n3. composer install\n4. have .htaccess set GOOGLE_APPLICATION_CREDENTIALS to the path of the readership map's .json file.\n\n```\nsetenv GOOGLE_APPLICATION_CREDENTIALS /path/to/readership-map.json\n```\n5. View the map at index.html\n6. See the data at data.php\n\n## Low-latency mode\n\nBecause data.php takes some time to run:\n\n1. `git clone https://github.com/mlibrary/readership-map`\n2. `cd readership-map`\n3. `composer install`\n4. `GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials/file php data.php \u003e pins.json`\n5. `php readership-map.js.php \u003e readership-map.js`\n6. Copy `index.html` `*.js` and `*.json` to the place where the maps are served.\n7. Have cron run `GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials/file php data.php \u003e pins.tmp \u0026\u0026 mv pins.tmp pins.js`\n\n\n## TODO\n\nInvestigate [enhanced ecommerce for Google Analytics](https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce#measure_product_detail_views).\n\n```javascript\ngtag('event', 'view_item', {\n  \"items\": [\n    {\n      \"id\": \"P12345\",\n      \"name\": \"Android Warhol T-Shirt\",\n      \"list_name\": \"Search Results\",\n      \"brand\": \"Google\",\n      \"category\": \"Apparel/T-Shirts\",\n      \"variant\": \"Black\",\n      \"list_position\": 1,\n      \"quantity\": 2,\n      \"price\": '2.0'\n    }\n  ]\n});\n```\n\nIn this case, I imagine we could encode the following:\n\n```yaml\nid: url\nname: title\nbrand: author\nvariant: open | subscription\n```\n\n`category` and `list_name` might be available for future use.  `list_position` are probably not going to be relevant.\nQuantity and price seem irrelevant, and unlikely to be useful.\n\nAn alternative to using the enhanced ecommerce gtag.js would be using the [Google Analytics Measurment protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters).\n\nPossible concerns: limits on the lengths of these fields\n\n500 bytes is the limit on most of the fields.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlibrary%2Freadership-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlibrary%2Freadership-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlibrary%2Freadership-map/lists"}