{"id":30339732,"url":"https://github.com/meinfernbus/googlebundle","last_synced_at":"2025-08-18T07:16:28.788Z","repository":{"id":2872259,"uuid":"3878019","full_name":"meinfernbus/GoogleBundle","owner":"meinfernbus","description":"Symfony Bundle for Google Analytics (Async Integration, Multi-Tracker Support, Default and Custom Page Views, Page View Queue, Ecommerce), Google Adwords, Google Maps (Static)","archived":false,"fork":false,"pushed_at":"2022-05-20T09:15:56.000Z","size":188,"stargazers_count":11,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-12T15:54:53.802Z","etag":null,"topics":["composer","ecommerce","google","google-adwords","google-analytics","google-maps","googlebundle","php","symfony-bundle","twig"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"songsiqi/px2rem","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meinfernbus.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}},"created_at":"2012-03-30T15:34:02.000Z","updated_at":"2024-06-12T16:45:35.000Z","dependencies_parsed_at":"2022-09-10T00:12:03.798Z","dependency_job_id":null,"html_url":"https://github.com/meinfernbus/GoogleBundle","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/meinfernbus/GoogleBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinfernbus%2FGoogleBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinfernbus%2FGoogleBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinfernbus%2FGoogleBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinfernbus%2FGoogleBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meinfernbus","download_url":"https://codeload.github.com/meinfernbus/GoogleBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meinfernbus%2FGoogleBundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270958073,"owners_count":24675320,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["composer","ecommerce","google","google-adwords","google-analytics","google-maps","googlebundle","php","symfony-bundle","twig"],"created_at":"2025-08-18T07:16:25.174Z","updated_at":"2025-08-18T07:16:28.781Z","avatar_url":"https://github.com/meinfernbus.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/meinfernbus/GoogleBundle.svg?branch=master)](https://travis-ci.org/meinfernbus/GoogleBundle)\n\n# GoogleBundle\n\nThe GoogleBundle adds the ability to add various google-related services\nto your application. These include Google Analytics, Adwords and Static Maps.\nThis module was forked a long time ago from https://github.com/antimattr/GoogleBundle but is now maintained as a separate project.\n\n## Installation\n\n### Composer\ncomposer require meinfernbus/google-bundle\n\n### Application Kernel\n\nAdd GoogleBundle to the `registerBundles()` method of your application kernel:\n\n```php\n    public function registerBundles()\n    {\n        return array(\n            new AntiMattr\\GoogleBundle\\GoogleBundle(),\n        );\n    }\n```\n\n## Configuration\n\n### Google Analytics\n\n#### Application config.yml\n\nEnable loading of the Google Analytics service by adding the following to\nthe application's `config.yml` file:\n\n```yaml\n    google:\n        analytics:\n            trackers:\n                default:\n                    name:      MyJavaScriptCompatibleVariableNameWithNoSpaces\n                    accountId: UA-xxxx-x\n                    domain:    .mydomain.com\n                    trackPageLoadTime: true\n                    anonymizeIp: false\n```\n\n#### View\n\nInclude the Google Analytics Async template in the `head` tag or just before the `\u003c/body\u003e` of your layout (The template will lazy load _gaq).\n\nWith twig:\n\n```twig\n    {% include \"GoogleBundle:Analytics:async.html.twig\" %}\n```\n\n#### Features\n\n##### Logging a Default Page View\n\n    Requires no additional code\n\n##### Sending a Custom Page View\n\n```php\n    $this-\u003econtainer()-\u003eget('google.analytics')-\u003esetCustomPageView('/profile/'.$username);\n```\n\n##### Adding to Page View Queue\n\nNote: Page View Queue is always executed before a Custom Page View\n\n```php\n    $this-\u003econtainer()-\u003eget('google.analytics')-\u003eenqueuePageView('/my-first-page-view-in-queue');\n    $this-\u003econtainer()-\u003eget('google.analytics')-\u003eenqueuePageView('/my-second-page-view-in-queue');\n```\n\n##### Ecommerce Tracking\n\n```php\n    $transaction = new \\AntiMattr\\GoogleBundle\\Analytics\\Transaction();\n    $transaction-\u003esetOrderNumber('xxxx');\n    $transaction-\u003esetAffiliation('Store 777');\n    $transaction-\u003esetTotal(100.00);\n    $transaction-\u003esetTax(10.00);\n    $transaction-\u003esetShipping(5.00);\n    $transaction-\u003esetCity(\"NYC\");\n    $transaction-\u003esetState(\"NY\");\n    $transaction-\u003esetCountry(\"USA\");\n    $this-\u003eget('google.analytics')-\u003esetTransaction($transaction);\n\n    $item = new \\AntiMattr\\GoogleBundle\\Analytics\\Item();\n    $item-\u003esetOrderNumber('xxxx');\n    $item-\u003esetSku('zzzz');\n    $item-\u003esetName('Product X');\n    $item-\u003esetCategory('Category A');\n    $item-\u003esetPrice(50.00);\n    $item-\u003esetQuantity(1);\n    $this-\u003eget('google.analytics')-\u003eaddItem($item);\n\n    $item = new \\AntiMattr\\GoogleBundle\\Analytics\\Item();\n    $item-\u003esetOrderNumber('bbbb');\n    $item-\u003esetSku('jjjj');\n    $item-\u003esetName('Product Y');\n    $item-\u003esetCategory('Category B');\n    $item-\u003esetPrice(25.00);\n    $item-\u003esetQuantity(2);\n    $this-\u003eget('google.analytics')-\u003eaddItem($item);\n```\n\n### Google Adwords\n\n#### Application config.yml\n\nEnable loading of the Google Adwords service by adding the following to\nthe applications's `config.yml` file:\n\n```yaml\n    google:\n        adwords:\n            conversions:\n                account_create:\n                    id:    111111\n                    label: accountCreateLabel\n                    value: 0\n                    remarketing: false\n                checkout_thanks:\n                    id:    222222\n                    label: checkoutThanksLabel\n                    value: 0\n                    remarketing: false\n                remarketing:\n                    id:    333333\n                    label: \"google-assigned-remarketing-label\"\n                    value: 0\n                    remarketing: true\n```\n\n#### Controller\n\n```php\n    $this-\u003eget('google.adwords')-\u003eactivateConversionByKey('account_create');\n```\n\n#### View\n\nInclude the Google Adwords tracking template like this\n\n```twig\n    {% include \"GoogleBundle:Adwords:track.html.twig\" %}\n```\n\n### Google Maps - Static Map\n\n#### Application config.yml\n\nEnable loading of the Google Maps Static service by adding the following to\nthe applications's `config.yml` file:\n\n```yaml\ngoogle:\n    maps:\n        config:\n            key: YOUR-API-KEY-FROM-GOOGLE\n            host: YOUR-HOST // Host where the gmap image is served.\n            (Optional, only needed if script is running from CLI. If not set $_SERVER is used)\n            uploadDir: '%kernel.project_dir%/web/maps' // absolute path to directory where map files\n            publicDir: '/maps' //http path where map files supposed to be publicly available\n           \n```\n\nGet your key at https://code.google.com/apis/console/\n\n#### Controller\n\n```php\n    use AntiMattr\\GoogleBundle\\Maps\\StaticMap;\n    use AntiMattr\\GoogleBundle\\Maps\\Marker;\n\n    ...\n\n    /** @var \\AntiMattr\\GoogleBundle\\MapsManager $googleContainer */\n    $googleContainer = $this-\u003econtainer-\u003eget('google.maps');\n    $map = $googleContainer-\u003ecreateStaticMap();\n    $map-\u003esetId(\"Paul\");\n    $map-\u003esetSize(\"512x512\");\n    $marker = new Marker();\n    $marker-\u003esetLatitude(40.596631);\n    $marker-\u003esetLongitude(-73.972359);\n    $map-\u003eaddMarker($marker);\n    $googleContainer-\u003eaddMap($map);\n```\n\n#### View\n\nInclude the Google Maps in your template like this:\n\n```twig\n    {% if google_maps.hasMaps() %}\n\t\t{% for map in google_maps.getMaps() %}\n\t\t\t{% autoescape false %}\n\t\t\t\t{{ map.render }}\n\t\t\t{% endautoescape %}\n\t\t{% endfor %}\n\t{% endif %}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeinfernbus%2Fgooglebundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeinfernbus%2Fgooglebundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeinfernbus%2Fgooglebundle/lists"}