GDFP adverts.
- Source:
Methods
(static) .init(contextopt)
Initialise Google DFP adverts.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
context |
object |
<optional> |
document | DOM element that we are adding adverts to. |
- Source:
Example
UCASDesignFramework.googleadverts.init()
(static) .insertAdverts(contextopt, immediateLoadopt) → {bool}
Insert new advert slots based on the context passed in.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
context |
object |
<optional> |
document | DOM element that contains the new advert slot we want to load. |
immediateLoad |
bool |
<optional> |
true | Bool to decide whether to immediately load an advert or wait until all are defined and then load. |
- Source:
Returns:
- success
- Type
- bool
(static) .refreshAdverts(contextopt, idsopt)
Refresh the adverts in a context. Performs a simple reload of each advert.
E.g. loads a new advert for the slot should it have multiple creatives defined in DFP.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
context |
object |
<optional> |
document | DOM element that contains the adverts we want to refresh. |
ids |
object |
<optional> |
list of slot placement ids to refresh adverts for. Optional parameter, if null then obtain placement Ids from the passed context. If the context is document then we don't require the Ids as we're refreshing all ads on the page. We could obviously do without this parameter but if we've already obtain the list of Ids, it saves querying the DOM again. |
- Source: