-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add tracdelight AMP ad integration (#23124)
* Add tracdelight AMP ad integration * TRAC-297: change domain of the script to scripts.tracdelight.io * examples/ads.amp.html: update sample tracdelight widget * TRAC-297: fix year in copyright header
- Loading branch information
1 parent
5417071
commit 7991473
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright 2018 The AMP HTML Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS-IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import {validateData, writeScript} from '../3p/3p'; | ||
|
||
/** | ||
* @param {!Window} global | ||
* @param {!Object} data | ||
*/ | ||
export function tracdelight(global, data) { | ||
const mandatoryFields = ['widget_id', 'access_key']; | ||
const optionalFields = ['mode']; | ||
|
||
validateData(data, mandatoryFields, optionalFields); | ||
|
||
global.tdData = data; | ||
writeScript(global, 'https://scripts.tracdelight.io/amp.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!--- | ||
Copyright 2019 The AMP HTML Authors. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS-IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
# tracdelight | ||
|
||
## Example | ||
|
||
```html | ||
<amp-ad height="232" width="640" | ||
type="tracdelight" | ||
data-mode="iframe" | ||
data-widget_id="[widget-id]" | ||
data-access_key="[access-key]"> | ||
</amp-ad> | ||
``` | ||
|
||
## Configuration | ||
|
||
For semantics of configuration, please see [ad network documentation](http://docs.tracdelight.com/). | ||
|
||
Required parameters: | ||
- data-widget_id: the id of the widget | ||
- data-access_key: the access key | ||
|
||
Optional parameters | ||
- data-mode: how to embed the widget. Possible values are "iframe" or "inline" (default: "iframe") | ||
|
||
|
||
## Support | ||
|
||
If you have any questions, please refer to your contact at tracdelight or contact support@tracdelight.com. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters