Using preview mode

Hi,

I’m trying to set up a tag and trigger to track a click on link element which is inside a div element.

I used this documentation:

My issue is this one:
I enable preview mode on a page which contains the element I want to track, ok
I click on the element.
But this click follow the link that I want to track, so the new page does not show the preview mode window, and so, I’m not able to see if my tag has been triggered …

Is there a configuration I missed, which allow to keep this preview window open and active when we change page in following a link ?

Thanks in advance for any help.
Best regards

Hi!

With the preview mode you can only preview a single page. But you can workaround that if you use a right click on the element instead of a left click. The tags and triggers usually get fired this way also. Maybe that helps.

1 Like

Hi Florian,

Ah ok… thanks for your tip: I did not think about this way !

So, thanks to you, I notice that my small configuration does not work … Not unusual !
As I’ve been going in circles for several days on this simple problem, I think I’ll open a new topic to get some help.
Anyway, thanks for this tip.

For an another reason you can test a solution with temporary event.preventDefault(). Open the Webpage, open the browser console and put and run this code:

var linksarray = document.getElementsByTagName("a");
for (var i = 0; i < linksarray.length; i++) {
linksarray[i].addEventListener("click", function() {event.preventDefault();});
} 

After, all links are (temporary) dead.
consider: this is untested.

1 Like

Hi Melbao,

Thanks a lot for your answer.
You’re right, with your code, all links are dead. So I’m now able to continue my research for triggering this element…
Your tip is really useful !
Best regards