if (adtoniq) {"; $proxyServer = get_option('adtoniq-debug-proxy-server', ''); $cssSelector = get_option('adtoniq-as-css-selector', "ins,[id^='div-gpt-ad']"); $filter = get_option('adtoniq-debug-proxy-filter', ''); if (strlen($filter) > 0) $result .= "if (adtoniq.setFilter) adtoniq.setFilter('" . $filter . "');"; if (strlen($cssSelector) == 0) $cssSelector = "ins,[id^='div-gpt-ad']"; $cssSelector = str_replace('"', '\'', $cssSelector); adtoniq_add_event("CSS Selector is: " . $cssSelector); $result .= "adtoniq.setAdUnitLocator(function() {return document.querySelectorAll(\"" . $cssSelector . "\")}); // 1"; if (strlen($proxyServer) > 0) { $result .= " var ps = '" . $proxyServer . "';"; } else { $result .= " var ps = adtoniq.getProxy(); "; } $result .= " adtoniq.onBlocked(function(adtoniqCookie, proxyServer) { function doit() { adtoniq.inflateAdUnit('ins', '" . get_option('adtoniq-as-publisher-id') . "', '" . get_option('adtoniq-as-max-ads') . "', '" . get_option('adtoniq-as-data-ad-layout') . "', '" . get_option('adtoniq-as-data-ad-format') . "', '" . get_option('adtoniq-as-data-ad-slot') . "' ); } if (adtoniqCookie != 'track') { adtoniq.onOptIn(doit); } else { doit(); }"; $result .= " });}"; } return $result; } function adtoniq_as_extract_attributes() { $codeSnippet = get_option("adtoniq-as-code-snippet"); $this->adtoniq_as_extract_attribute($codeSnippet, "data-ad-layout"); $this->adtoniq_as_extract_attribute($codeSnippet, "data-ad-format"); $this->adtoniq_as_extract_attribute($codeSnippet, "data-ad-client"); $this->adtoniq_as_extract_attribute($codeSnippet, "data-ad-slot"); } function adtoniq_as_extract_attribute($codeSnippet, $name) { $startName = strpos($codeSnippet, $name); $value = ''; if ($startName !== false) { $startValue = strpos($codeSnippet, "\"", $startName) + 1; $endValue = strpos($codeSnippet, "\"", $startValue); $length = $endValue - $startValue; $value = substr($codeSnippet, $startValue, $length); } adtoniq_update_option('adtoniq-as-' . $name, $value, true); adtoniq_add_event('Set adtoniq-as-' . $name . ' to ' . $value); } /** * Show save modal * * @since 4.0.0 */ function adtoniq_as_render_update() { ?>
Changes Saved!
_apiKey) === 0) { ?> This feature requires an Adtoniq Cloud account. Sign up for an Adtoniq Cloud account and receive one month free. No credit card is required unless you want to continue using Adtoniq server features after your one month trial.
Thank you for using Adtoniq. You can sign in to your Adtoniq Cloud account to authorize additional websites and view your bills.