Last active
March 3, 2021 09:55
-
-
Save saevarom/1f4f22a8a946b562c3e9e84252138538 to your computer and use it in GitHub Desktop.
React adzone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class Ad extends React.Component { | |
/* | |
Usage in React JSX: | |
<Ad zoneId={'your zone id from Airserve'} /> | |
*/ | |
constructor(props) { | |
super(props) | |
} | |
componentDidMount(){ | |
processZone(`oc-adzone-${this.props.zoneId}`, true) | |
} | |
render() { | |
let div = <div data-zone={`oc-adzone-${this.props.zoneId}`}></div> | |
return div | |
} | |
} | |
Ad.defaultProps = { | |
zoneId: '' | |
} | |
export default Ad; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src='//static.airserve.net/frett/websites/_WEBSITE_NAME_/webscript.js'></script> | |
<script data-overcast='queue' src='//heartbeat.airserve.net/js/airserve/v10/airserve.js?autorenderzone=1&async=1'></script> | |
</head> | |
<body> | |
<!-- render your app here --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment