Skip to content

Commit

Permalink
✨ Add tracdelight AMP ad integration (#23124)
Browse files Browse the repository at this point in the history
* 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
thekorn authored and calebcordry committed Oct 8, 2019
1 parent 5417071 commit 7991473
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ import {taboola} from '../ads/taboola';
import {tcsemotion} from '../ads/tcsemotion';
import {teads} from '../ads/teads';
import {torimochi} from '../ads/torimochi';
import {tracdelight} from '../ads/tracdelight';
import {triplelift} from '../ads/triplelift';
import {trugaze} from '../ads/trugaze';
import {uas} from '../ads/uas';
Expand Down Expand Up @@ -524,6 +525,7 @@ register('taboola', taboola);
register('tcsemotion', tcsemotion);
register('teads', teads);
register('torimochi', torimochi);
register('tracdelight', tracdelight);
register('triplelift', triplelift);
register('trugaze', trugaze);
register('twitter', twitter);
Expand Down
5 changes: 5 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,11 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},

'tracdelight': {
prefetch: 'https://scripts.tracdelight.io/amp.js',
renderStartImplemented: true,
},

'triplelift': {},

'trugaze': {
Expand Down
31 changes: 31 additions & 0 deletions ads/tracdelight.js
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');
}
44 changes: 44 additions & 0 deletions ads/tracdelight.md
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.
9 changes: 9 additions & 0 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
<option>tcsemotion</option>
<option>teads</option>
<option>torimochi</option>
<option>tracdelight</option>
<option>triplelift</option>
<option>trugaze</option>
<option>uas</option>
Expand Down Expand Up @@ -2070,6 +2071,14 @@ <h2>Torimochi</h2>
>
</amp-ad>

<h2>Tracdelight</h2>
<amp-ad height="300" width="640"
type="tracdelight"
data-mode="inline"
data-widget_id="yqrmkcpv89h7gbds"
data-access_key="165a54e8462bacfb08ada26ebf11990c">
</amp-ad>

<h2>TripleLift</h2>
<amp-ad width="297" height="410"
type="triplelift"
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-ad/amp-ad.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ See [amp-ad rules](https://github.com/ampproject/amphtml/blob/master/extensions/
- [TcsEmotion](../../ads/tcsemotion.md)
- [Teads](../../ads/teads.md)
- [torimochi](../../ads/torimochi.md)
- [Tracdelight](../../ads/tracdelight.md)
- [TripleLift](../../ads/triplelift.md)
- [Trugaze](../../ads/trugaze.md)
- [UZOU](../../ads/uzou.md)
Expand Down

0 comments on commit 7991473

Please sign in to comment.