@site
Description
The @site context query describes information about the site and page that is requesting the ad.
Example Usage
In order to be as contextually relevant as possible, some ads be desire the headline of the ad to change based on what site the ad is loading on.
.headline::before {
content: 'Hey, You!';
@site (domain: espn.com) {
content: 'Hey, Sports Fan!';
}
@site (domain: gizmodo.com) {
content: 'Hey, Gearhead!';
}
@site (domain: hbr.org) {
content: "Hey, Smartypants!
}
}
Available Features
| Feature Name | Javascript Name | Value | Example Value | Description |
|---|---|---|---|---|
loaded | siteLoaded | boolean | true | Boolean that notes if the content page has loaded completely. |
scrolling | siteScrolling | boolean | false | Boolean that notes if the content page is scrolling. |
type | siteType | website app | site | The kind of content that the ad is loading within (i.e a website or an app). |
domain | siteDomain | string | gospecless.com | The full domain of the page requesting the ad. |
hostname | siteHostname | string | app.gospecless.com | The full hostname of the URL. |
url | siteURL | string | http://gospecless.com/pubishers/ | The full URL of the content page requesting the ad. |
title | siteTitle | string | This is an Article Title | The full title of the page requesting the ad. |
path | sitePath | string | /publishers/ | The portion of the URL that defines the path to the current content. |
protocol | siteProtocol | string | http https | The protocol being used to request the parent page. |
search | siteSearch | string | search=whatever&something=that | The portion of the URL that comes after the '?' mark. |
hash | siteHash | string | anchor | The portion of the URL that comes after the '#' sign in the url. |
width | siteWidth | number | 1024 | The width of the parent page document. |
height | siteHeight | number | 5678 | The height of the parent page document. |
scroll-x | siteScrollX | number | 256 | How far the current parent page document has scrolled along the x-axis in pixels. |
scroll-y | siteScrollY | number | 3024 | How far the current parent page document has scrolled along the Y-axis in pixels. |
screen-top | siteScreenTop | number | -254 | The distance from the top of the document to the top of the screen. |
screen-right | siteScreenRight | number | -20 | The distance from the right of the document to the right side of the screen. |
screen-bottom | siteScreenBottom | number | -24 | The distance from the bottom of the document to the bottom of the screen. |
screen-left | siteScreenLeft | number | -10 | The distance from the left of the document to the left side of the screen. |
viewport-top | siteViewportTop | number | 0 | The distance from the top of the document to the top of the viewport. |
viewport-right | siteViewportRight | number | 0 | The distance from the right of the document to the right side of the viewport. |
viewport-bottom | siteViewportBottom | number | -3024 | The distance from the bottom of the document to the bottom of the viewport. |
viewport-left | siteViewportLeft | number | 0 | The distance from the left of the document to the left side of the viewport. |
Updated less than a minute ago
