Content tracking and lightboxes


#1

Hello all,

I haven’t been able to find anything about this the documentation - we have a lightbox that appears when the visitor leaves the site (using Ouibounce), ie when the mouse moves outside the viewport the lightbox changes from display none to visible.

I would like to track how often this lightboxes appears and is then interacted with, but would this work using content tracking?

I could use events but I feel content tracking would be better.

Thanks for your help,
Alex


(Matthieu Aubry) #2

Hi Alex,

Content Tracking should work here, can you try it?


#3

Hi Matt,

Yes, I tried it out quickly before posting - it seemed to count the number of impressions ok, but not the number of interactions, which was too low.

I also have event tracking onclick on the form button that’s part of the content block if that’s relevant.

Any ideas, or perhaps it browser specific?
Alex


(Matthieu Aubry) #4

Any ideas, or perhaps it browser specific?

Any chance you could create a small HTML/JS page where you can reproduce the issue? maybe we can improve the content tracking to accurately track impressions in this case, if we can reproduce the issue


#5

Hi Matt,

I’d like to give this a week and take it from there.

2 reasons - this content box normally gets 1-2 clicks a day so it’s perhaps not so accurate, but mostly, I’ve noticed today that they are registering, just not immediately - it seems to be taking a few minutes to show up in piwik for some reason.

A minimalist version of the code I’m using if it helps:



<div class="modal" data-track-content data-content-name="..." data-content-piece="..">
<div class="modal-body">
<p>text</p>
<form name="...." method="post" action="..." >
fields
<input type="submit" name="submit" value="..." data-content-target="........" onmousedown="javascript:_paq.push(['trackEvent',....,'...',location.pathname.substring(1)]);_paq.push(['setCustomVariable',5,'...',document.getElementById('...').value,'visit']);_paq.push(['trackPageView']);"/>
</form>
</div>
</div>


#6

I think I might have solved this one.

Must content tracking have only 1 data-content-target attribute?

In the data-content-name and piece container I have 2 buttons, so I’ve attached the target to each with different values (I noticed the values aren’t reported anywhere?)

It seems that only the first of the 2 targets is having its interactions counted, possibly. So I have to set up 2 data-content-names and data-content-pieces so add some more divs and spans?


#7

bump