Skip to content

Commit

Permalink
✨🚀Widget Optimized [TE Medya] (#27122)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload

* Update temedya.js

* Update integration.js

* Update _config.js

* Update temedya.js

* Update ads.amp.html

* Update _config.js

* Update amp-ad.md

* Update temedya.md

* Update _config.js

* Update temedya.js

* Update temedya.js

* Update temedya.js

* Update _config.js

* Update _config.js

* Update temedya.js

* Update temedya.js

* Update temedya.md

* Update temedya.md

* Update temedya.js

* Update temedya.js

* Update temedya.js

* Update temedya.md

* Update temedya.md

* Update temedya.md

* Update temedya.js

* Update temedya.md

* Update temedya.md

* Update temedya.md

* Update temedya.js

* Update temedya.js

* Update temedya.md

* Update temedya.js

* Update temedya.js

* Update temedya.md

* Update temedya.js

* Update _config.js

* Update ads.amp.html

* Update temedya.md

* Update temedya.md

* Update temedya.md

* Update temedya.md
  • Loading branch information
vidyome authored Mar 16, 2020
1 parent 0774f1b commit 3ddcd4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 37 deletions.
2 changes: 1 addition & 1 deletion ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ const adConfig = jsonConfiguration({

'temedya': {
prefetch: [
'https://vidyome-com.cdn.vidyome.com/vidyome/builds/temedya-amp.js',
'https://widget.cdn.vidyome.com/builds/loader-amp.js',
'https://vidyome-com.cdn.vidyome.com/vidyome/builds/widgets.js',
],
renderStartImplemented: true,
Expand Down
13 changes: 3 additions & 10 deletions ads/temedya.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,9 @@ import {loadScript, validateData} from '../3p/3p';
* @param {!Object} data
*/
export function temedya(global, data) {
validateData(data, ['keyid']);
validateData(data, ['widgetid']);
global._temedya = global._temedya || {
title: data['title'] || 'false',
keyId: data['keyid'],
siteId: data['siteid'],
siteUrl: data['siteurl'] || global.context.canonicalUrl,
typeId: data['typeid'] || 7,
paidItem: data['paiditem'] || 4,
organicItem: data['organicitem'] || 0,
theme: data['theme'] || 'google',
widgetId: data['widgetid'],
};
global._temedya.AMPCallbacks = {
renderStart: global.context.renderStart,
Expand All @@ -39,7 +32,7 @@ export function temedya(global, data) {
// load the temedya AMP JS file script asynchronously
loadScript(
global,
'https://vidyome-com.cdn.vidyome.com/vidyome/builds/temedya-amp.js',
'https://widget.cdn.vidyome.com/builds/loader-amp.js',
() => {},
global.context.noContentAvailable
);
Expand Down
20 changes: 2 additions & 18 deletions ads/temedya.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,13 @@ limitations under the License.
height="320"
type="temedya"
layout="responsive"
data-title="widget-title"
data-siteId="site-id"
data-keyId="key-id"
data-siteUrl="site-url"
data-typeId="ad-type"
data-paidItem="paid-item-count"
data-organicItem="organic-item-count"
data-theme="theme-style"
data-widgetId="vidyome"
>
</amp-embed>
```

## Configuration

For details on the configuration semantics, please contact the ad network or refer to their documentation.

### Required parameters

- `data-title`: Widget Title
- `data-siteId`: Vidyome Website Id
- `data-keyId`: Vidyome Widget Key Id
- `data-siteUrl`: Web Site URL
- `data-typeId`: Widget Type ID (7)
- `data-paidItem`: Paid Item Count
- `data-organicItem`: Organic Item Count
- `data-theme`: Theme Type (light | dark | google)
- `data-widgetId`: Widget ID
9 changes: 1 addition & 8 deletions examples/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -2160,14 +2160,7 @@ <h2>TE Medya</h2>
<amp-embed width="320" height="320"
type="temedya"
layout="responsive"
data-title="widget-title"
data-siteId="site-id"
data-keyId="key-id"
data-siteUrl="site-url"
data-typeId="ad-type"
data-paidItem="paid-item-count"
data-organicItem="organic-item-count"
data-theme="theme-style"
data-widgetId="vidyome"
>
</amp-embed>

Expand Down

0 comments on commit 3ddcd4e

Please sign in to comment.