Created
June 18, 2018 10:34
-
-
Save cssimsek/3da0087d1aa94a6c567915db1ec5f9e4 to your computer and use it in GitHub Desktop.
Lytics Audiences to DFP Integration JS - from https://goo.gl/CyUnFf
This file contains 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
!function (l, a) { | |
a.liosetup = a.liosetup || {}, a.liosetup.callback = a.liosetup.callback || [], a.liosetup.addCallback = function (l) { | |
if ("function" == typeof a.liosetup.callback) { | |
var o = []; | |
o.push(a.liosetup.callback), a.liosetup.callback = o | |
} | |
a.lio && a.lio.loaded ? l(a.lio.data) : a.liosetup.callback.push(l) | |
} | |
}(document, window); | |
!function (o, g) { | |
g.googletag = g.googletag || {}, g.googletag.cmd = g.googletag.cmd || [], "undefined" != typeof g.googletag ? g.googletag.cmd.push(function () { | |
g.googletag.pubads().disableInitialLoad() | |
}) : console.warn("attempting to load Lytics for DFP before initializing googletag"), g.liosetup.callback.push(function (o) { | |
o || o.segments ? g.googletag.cmd.push(function () { | |
g.googletag.pubads().setTargeting("LyticsSegments", o.segments), g.googletag.pubads().refresh() | |
}) : (console.warn("unable to load Lytics audiences for DFP"), g.googletag.pubads().refresh()) | |
}) | |
}(document, window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment