interstitial

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package interstitial provides XML markup parsing utilities for interstitial ad formats. It is an internal package shared between the banner and direct response subpackages to avoid circular imports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAdMarkup

func ParseAdMarkup(adMarkup string) (pageURL, clickURL, imgURL string, err error)

ParseAdMarkup parses XML ad markup for interstitial ad formats and extracts the relevant URL components. It supports the following ad types embedded in the XML:

  • iframeAd: returns the iframe URL as pageURL
  • popunderAd: returns the popunder URL as pageURL
  • imageAd: returns clickURL and imgURL

Example iframeAd markup:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ad>
  <iframeAd>
    <url><![CDATA[https://example.com/iframe]]></url>
  </iframeAd>
</ad>

Example imageAd markup:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ad>
  <imageAd>
    <clickUrl><![CDATA[https://example.com/redirect]]></clickUrl>
    <imgUrl><![CDATA[https://i.imgur.com/bRoshBm_d.webp]]></imgUrl>
  </imageAd>
</ad>

Example popunderAd markup:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ad>
  <popunderAd>
    <url><![CDATA[https://example.com/popunder]]></url>
  </popunderAd>
</ad>

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL