Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider changing ad on fragment/anchor change #24

Open
davidfischer opened this issue Jul 24, 2020 · 3 comments
Open

Consider changing ad on fragment/anchor change #24

davidfischer opened this issue Jul 24, 2020 · 3 comments
Labels
Needed: design decision A core team decision is required

Comments

@davidfischer
Copy link
Contributor

Some other ad networks change the ad when the fragment/anchor changes. This becomes especially important on single page applications when the page doesn't reload. There are a few considerations here:

  • We should probably debounce this. While the server should limit things so advertisers aren't overbilled, we probably shouldn't change ads more frequently than a certain amount of time (at least 5-10s I'd say).
  • This might depend on viewport detection (Ad in viewport detection #12) which isn't live yet. Sometimes ads are at the top of the page while anchors are far down the page.
@davidfischer davidfischer added the Needed: design decision A core team decision is required label Jul 24, 2020
@mtxr
Copy link

mtxr commented Jul 25, 2020

Is it ok if I work on this one? @davidfischer

@davidfischer
Copy link
Contributor Author

@mtxr We welcome the help.

@Geometrically
Copy link

Hi! I fixed this using vue by creating a seperate Ads component for all my ads, and loading them when the component is mounted. It worked fine for SPA navigation.

<template>
  <div
    class="ethical-ad"
    data-ea-publisher="modrinth-com"
    :data-ea-type="type"
    data-ea-manual="true"
  />
</template>

<script>
export default {
  name: 'EthicalAd',
  props: {
    type: {
      type: String,
      default: 'text',
    },
  },
  mounted() {
    try {
      // eslint-disable-next-line no-undef
      ethicalads.load()
    } catch (err) {
      // eslint-disable-next-line no-console
      console.error(err)
    }
  },
}
</script>

<style scoped>
...
</style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants