Not registering clicks
Closed this issue · 5 comments
hafizovic commented
hafizovic commented
P.S. Im using Sprig to inject ad
hafizovic commented
For everybody who have the same issue, this is my current solution
Its pretty much based on this comment https://github.com/doublesecretagency/craft-adwizard/issues/9#issuecomment-833375065
only difference is to change this
data[window.csrfTokenName] = result;
with
data['CRAFT_CSRF_TOKEN'] = result;
diegocosta-dev commented
I have the same problem. can anyone help me?
Sprig Componente:
{# prettier-ignore-start #}
{% if sprig.isRequest %}
{% set leaderboard = craft.adWizard.ads.group('leaderboard').orderBy('RAND()')|first %}
{% if leaderboard %}
<div class="p-3 bg-white">
<div class="w-full max-w-[728px] mx-auto rounded-[4px] overflow-hidden">
{{ leaderboard.displayAd({
'attr': {
'class': 'leaderboard',
},
}) }}
</div>
</div>
{% endif %}
{% endif %}
{# prettier-ignore-start #}
Inject
{{ sprig('_sprig/headerAds', {}, { 's-trigger': 'load' }) }}
hafizovic commented
{# prettier-ignore-start #}
Looks like you're completely missing JS files from AdWizard
diegocosta-dev commented
Looks like you're completely missing JS files from AdWizard
Yes, I was really forgetting. I managed to solve it based on this discussion.
Thanks.