{"id":17458162,"url":"https://github.com/pocesar/angular-ecommerce-analytics","last_synced_at":"2025-07-01T10:33:43.778Z","repository":{"id":30359008,"uuid":"33911492","full_name":"pocesar/angular-ecommerce-analytics","owner":"pocesar","description":"Google Analytics Ecommerce helper with tracking events ","archived":false,"fork":false,"pushed_at":"2015-08-11T09:38:54.000Z","size":176,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-03T11:32:33.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocesar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-14T04:52:29.000Z","updated_at":"2024-09-26T02:43:28.000Z","dependencies_parsed_at":"2022-07-31T10:08:19.307Z","dependency_job_id":null,"html_url":"https://github.com/pocesar/angular-ecommerce-analytics","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pocesar/angular-ecommerce-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-ecommerce-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-ecommerce-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-ecommerce-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-ecommerce-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocesar","download_url":"https://codeload.github.com/pocesar/angular-ecommerce-analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-ecommerce-analytics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262944404,"owners_count":23388748,"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-10-18T03:55:49.391Z","updated_at":"2025-07-01T10:33:43.719Z","avatar_url":"https://github.com/pocesar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-ecommerce-analytics\n[Google Analytics Ecommerce](https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce) helper with tracking events  \n\n## Install\n\n```bash\nbower install angular-ecommerce-analytics\n```\n\n## Usage\n\n#### Service\n\n```js\n// add your GA.js code before this script\nangular.module('App', ['Analytics']).run(['$analytics', function($analytics){\n    // send by code\n    $analytics.setAction(4 /* CHECKOUT */, {\n        'step': 2\n    }).event({\n        eventAction: 'checkout',\n        eventCategory: 'plans',\n        eventLabel: 'do-checkout-button'\n    });\n    \n    $analytics.addProduct({\n        id: '1',\n        name: 'product',\n        price: 100\n    });\n    $analytics.setAction(2 /* ADD */);\n    $analytics.setAction(3 /* REMOVE */);\n    \n    $analytics.event({\n        eventCategory: 'button',\n        eventAction: 'action',\n        eventLabel: 'label',\n        eventValue: 'value'\n    });\n    \n    try {\n        lol++;    \n    } catch (e) {\n      $analytics.exception({\n        exDescription: 'error: ' + e\n      });\n    }\n    \n    $analytics.pageView({\n        // page: '/randomurl/1'\n    });\n    $analytics.social({\n        socialNetwork: 'facebook',\n        socialAction: 'like',\n        socialTarget: url\n    });\n}]);\n```\n\n#### Directive\n\n* `analytics` Support multiple events, either separated by space or by commas\n* `analytics-if` Conditional to trigger the sending of the event, optional\n* `analytics-category` Category of the event\n* `analytics-label` How it will show in the analytics panel\n* `analytics-value` The value assigned to the event\n\nEvery attribute are evaluated for expressions, so literal strings must be set as `'some string'`\n\nThe same events (click, mouseover, mouseenter, etc) still fires, since the directive won't do anything to\nthe event, and just send tracking data.\n\n```html\n\u003ca \n   analytics=\"click,mouseover,focus\" \n   analytics-if=\"ctrl.isCheckingOut()\" \n   analytics-category=\"'pay'\" \n   analytics-label=\"'debit'\" \n   target=\"_blank\" \n   class=\"btn btn-primary btn-pagamento\" \n   ng-href=\"{{url}}\"\n   \u003ePay with Debit\u003c/a\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangular-ecommerce-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocesar%2Fangular-ecommerce-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangular-ecommerce-analytics/lists"}