{"id":20940658,"url":"https://github.com/ianmurrays/ngdfp","last_synced_at":"2025-05-13T23:30:41.377Z","repository":{"id":17643524,"uuid":"20447984","full_name":"ianmurrays/ngDfp","owner":"ianmurrays","description":"DoubleClick For Publishers for Angular JS","archived":false,"fork":false,"pushed_at":"2018-05-01T06:35:25.000Z","size":57,"stargazers_count":52,"open_issues_count":22,"forks_count":39,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-10T11:38:15.517Z","etag":null,"topics":["angularjs","doubleclick"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ianmurrays.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":"2014-06-03T15:21:14.000Z","updated_at":"2023-09-07T10:42:07.000Z","dependencies_parsed_at":"2022-09-06T03:50:20.117Z","dependency_job_id":null,"html_url":"https://github.com/ianmurrays/ngDfp","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmurrays%2FngDfp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmurrays%2FngDfp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmurrays%2FngDfp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmurrays%2FngDfp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmurrays","download_url":"https://codeload.github.com/ianmurrays/ngDfp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225265039,"owners_count":17446757,"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":["angularjs","doubleclick"],"created_at":"2024-11-18T23:11:20.880Z","updated_at":"2024-11-18T23:11:21.522Z","avatar_url":"https://github.com/ianmurrays.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ngDfp\n=====\n\nngDfp is a simple library for Angular JS that allows you to add DoubleClick for Publishers tags to your Angular site.\n\nRequirements\n------------\n\nThis library requires Angular JS 1.2 or higher. It might work with older versions but I can't guarantee it.\n\nGetting Started\n---------------\n\nJust install via bower:\n\n    bower install ngDfp --save\n\nor npm:\n\n    npm install ngDfp --save\n\nThen, include it as a dependency:\n\n    angular.module('your.module', ['ngDfp'])\n\nand configure your slots in your app's config:\n\n    .config(function (DoubleClickProvider) {\n      DoubleClickProvider.defineSlot('/123456/Your_Slot', [100, 500], 'div-gpt-ad-1234567890123-0')\n                         .defineSlot('/123456/Your_Slot', [300, 200], 'div-gpt-ad-1234567890123-1');\n    });\n\nNow, to show an ad, simply use the `ng-dfp-ad`:\n\n    \u003cdiv data-ng-dfp-ad=\"div-gpt-ad-1234567890123-0\"\u003e\u003c/div\u003e\n\nRefreshing Ads\n--------------\n\nAds can be refreshed with a global interval or individually. To configure a global interval:\n\n    // Refresh all ads every 30 seconds\n    DoubleClickProvider.setRefreshInterval(30000);\n\nTo refresh an ad individually you can do two things:\n\n    \u003c!-- Refresh this ad every `refreshInterval` seconds --\u003e\n    \u003cdiv ng-dfp-ad=\"div-gpt-ad-1234567890123-0\" ng-dfp-ad-refresh-interval=\"{{refreshInterval}}\"\u003e\u003c/div\u003e\n    \nOr programatically with the provider:\n\n    app.controller(function (DoubleClick) {\n      DoubleClick.refreshAds('div-gpt-ad-1234567890123-0', 'div-gpt-ad-1234567890123-1');\n    });\n\nOptionally, you can refresh an ad individually immediately or after a defined timeout:\n```\n\u003c!-- Refresh this ad immediately --\u003e\n\u003cdiv ng-dfp-ad=\"div-gpt-ad-1234567890123-0\" ng-dfp-ad-refresh\u003e\u003c/div\u003e\n```\n```\n\u003c!-- Refresh this ad after `refreshTimeout` seconds --\u003e\n\u003cdiv ng-dfp-ad=\"div-gpt-ad-1234567890123-0\" ng-dfp-ad-refresh-timeout=\"{{refreshTimeout}}\"\u003e\u003c/div\u003e\n```\n\nHiding Emtpy Ads\n----------------\n\nAds can be hidden by adding the attribute `data-ng-dfp-ad-hide-when-empty` to the ad tag. You have to \nspecify the container of the ad using the data-ng-dfp-ad-container directive. This is useful if you contain\nthe ad in a parent div with some styles. For example, the following snippet will hide itself when empty:\n\n    \u003cdiv data-ng-dfp-ad=\"div-gpt-ad-1234567890123-0\" data-ng-dfp-ad-hide-when-empty data-ng-dfp-ad-container\u003e\u003c/div\u003e\n\nAnd the following will hide the container\n\n    \u003cdiv class=\"my-fancy-ad-container\" data-ng-dfp-ad-container\u003e\n      \u003cdiv data-ng-dfp-ad=\"div-gpt-ad-1234567890123-0\" data-ng-dfp-ad-hide-when-empty\u003e\u003c/div\u003e\n    \u003c/div\u003e\n\nResponsive Ads\n----------------\nYou can use Google Publisher Tags (GPT) to build responsive ads that fit the browser your visitors use to view your website. This means that your ads will look good whether your visitors are using a desktop, tablet, or smartphone.  \nMore information about [Building Responsive Ads](https://support.google.com/dfp_premium/answer/3423562?hl=en).\n\n```\nDoubleClickProvider.defineSlot('/123456/Your_Slot', [[970, 90], [728, 90], [88, 31]], 'div-gpt-ad-1431622560634-6');\nDoubleClickProvider\n    .defineSizeMapping('div-gpt-ad-1431622560634-6')\n    .addSize([1024, 768], [970, 90])\n    .addSize([980, 690], [728, 90])\n    .addSize([640, 480], [728, 90])\n    // Fits browsers of any size smaller than 640 x 480\n    .addSize([0, 0], [88, 31]);\n```\n\nMinimizing\n----------\n\nClosure Compiler is used to minimize the code. It is minimized using this command\n\n    closure-compiler --js_output_file=angular-dfp.min.js --compilation_level SIMPLE angular-dfp.js\n\nAdvanced optimizations are not used because as of now the AngularJS codebase does not support it.\n\nIssues\n------\n\nPlease file issues using GitHub's issue tracker.\n\nContributing\n------------\n\nPull requests are more than welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmurrays%2Fngdfp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmurrays%2Fngdfp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmurrays%2Fngdfp/lists"}