# Ebay EPN: Source map error

**URL:** <https://meta.discourse.org/t/ebay-epn-source-map-error/232770>\
**Category:** Development\
**Created:** [July 13, 2022, 6:44pm UTC](https://meta.discourse.org/t/ebay-epn-source-map-error/232770 "2022-07-13T18:44:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)\
**Post date:** [July 14, 2022, 2:41am UTC](https://meta.discourse.org/t/ebay-epn-source-map-error/232770/3 "2022-07-14T02:41:45Z")

</div>

Thanks for the info @Falco and happy birthday.

I figured out the problem was where I added that \<script src="… line.

This worked for me:

```plaintext
<script type="text/discourse-plugin" version="0.8">

  console.log(settings.epn_id);
  window._epn = {campaign: settings.epn_id, smartPopover:false};

  var script = document.createElement('script');
  script.src = 'https://epnt.ebay.com/static/epn-smart-tools.js';
  var head = document.getElementsByTagName("head")[0];
  head.appendChild(script);

</script>

```

The next problem I ran into is that elements that are dynamically loaded are do not have the script applied to them. For instance, if I refresh the page on a topic, the posts that load will have the affiliate link but scrolling to reveal more posts - those ones don’t.

Is there a way to run the script every time a new element is loaded?

---

_[View the full topic](https://meta.discourse.org/t/ebay-epn-source-map-error/232770)._
