Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ add new a1ads.js #40233

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ads/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ const adConfig = jsonConfiguration({
renderStartImplemented: true,
},

'a1ads': {
renderStartImplemented: true,
},

'a8': {
prefetch: 'https://statics.a8.net/amp/ad.js',
renderStartImplemented: true,
Expand Down
26 changes: 26 additions & 0 deletions ads/vendors/a1ads.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {validateData, writeScript} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function a1ads(global, data) {
validateData(data, ['adhost', 'a1path', 'adtag', 'sitepage', 'pos'], ['query']);

let url =
'https://' +
encodeURIComponent(data.adhost) +
'/' +
data.a1path +
'/' +
data.adtag +
'/' +
data.sitepage +
'@' +
data.pos;

if (data.query) {
url = url + '?' + data.query;
}
writeScript(global, url);
}
36 changes: 36 additions & 0 deletions ads/vendors/a1ads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# A1

## Examples
### Single ad
```
<amp-ad
width="300"
height="250"
type="a1ads"
data-adhost="AD_SRV_HOSTNAME"
data-a1path="/path-to-server"
data-adtag="adstream_sx.ads"
data-sitepage="adsite/page"
data-pos="Top"
data-query="keyword=keyvalue&key2=value2"
>
</amp-ad>
```


## Configuration

### Required parameters
`adhost`: Server Hostname start with protocol.

`a1path`: Path of adtag

`adtag`: ads tag name

`sitepage`: Sitepage configured for this ad spot.

`pos`: Position for the this ad spot.


### Optional parameters
`query`: Query parameter to be sent with request. Keywords and keynames, taxonomy etc.
Loading