#AMP SmartTag
##Overview
This AMP SmartTag (ampst) is intended to be used within DFP for pages built using AMP. For non-DFP ad-servers, please replace the DFP macros with your ad-server equivalents.
If you wish to use the Rubicon FastLane adapter directly on AMP pages, please visit the Rubicon adapter page.
##Secure sample tag in DFP (with first party data)
<!-- START: AMP SMART TAG -->
<script type="text/javascript" data-targeting='%%PATTERN:TARGETINGMAP%%' data-site="%%PATTERN:url%%" src="https://secure-assets.rubiconproject.com/utils/amp/rp-amp-st.min.js"></script>
<script>
// Set any first party visitor or inventory data. If no secondary parameter is specified, data-targeting will be used
ampst.setFPV('gender');
ampst.setFPI('position');
ampst.setKW('kw');
// Dynamically set visitor, inventory or keyword data (accepts an array of values or a comma seperated string for setFPV, setFPI or setKW)
ampst.setFPV('gender','male');
ampst.setFPI('section',['home','sports']);
ampst.setKW('kw','smart tag');
</script>
<script language="JavaScript" type="text/javascript">
rp_account = 'ACCOUNT_ID';
rp_site = 'SITE_ID';
rp_zonesize = 'ZONE_SIZE_ID';
rp_adtype = 'js';
rp_page = ampst.getSite();
rp_amp = 'st';
rp_kw = rpx_params.kw;
rp_visitor = rpx_params.visitor;
rp_inventory = rpx_params.inventory;
</script>
<script type="text/javascript" src="https://ads.rubiconproject.com/ad/ACCOUNT_ID.js"></script>
<!-- END: AMP SMART TAG -->
##Secure sample tag in DFP (without first party data)
<!-- START: AMP SMART TAG -->
<script type="text/javascript" data-site="%%PATTERN:url%%" src="https://secure-assets.rubiconproject.com/utils/amp/rp-amp-st.min.js"></script>
<script language="JavaScript" type="text/javascript">
rp_account = 'ACCOUNT_ID';
rp_site = 'SITE_ID';
rp_zonesize = 'ZONE_SIZE_ID';
rp_adtype = 'js';
rp_page = ampst.getSite();
rp_amp = 'st';
</script>
<script type="text/javascript" src="https://ads.rubiconproject.com/ad/ACCOUNT_ID.js"></script>
<!-- END: AMP SMART TAG -->
Variable Name | Description |
---|---|
data-targeting | JSON object containing any page/slot level targeting passed from the parent page. The required format is as follows: {"gender":["male"],"section":["homepage"]} |
data-site | Add the appropriate macro that resolves to the url of the page. |