I want to verify that facebook pixel 'track' event is actually firing when user perform signup ,
is there a way ? using Laravel dusk.
<<User successfully register's and then , pixel code is executed on the front side in the js.>>
I want to verify that facebook pixel 'track' event is actually firing when user perform signup ,
is there a way ? using Laravel dusk.
<<User successfully register's and then , pixel code is executed on the front side in the js.>>
Share Improve this question asked Mar 17 at 12:10 Sublan MustafaSublan Mustafa 3692 silver badges9 bronze badges 3- I have to write a test case bro , I wana implement it using dusk – Sublan Mustafa Commented Mar 17 at 12:35
- Can I check it through dusk ? – Sublan Mustafa Commented Mar 17 at 12:36
- What do you mean by "pixel code is executed"? If that happens through any frontend code (be it direct HTML or JS), how is PHP related? – Nico Haase Commented Mar 20 at 9:02
1 Answer
Reset to default 0I've successfully managed to do it ,
->assertScript('window.fbq.queue.length === 0'); //assumes that no fb events are pending
When user successfully register, a pixel event is fired.
fbq('track', 'Lead', {}, {eventID})
My task was to write a test case in laravel dusk for this event that, it is actually dispatches or not when user registers.
You can also check that fbq is actually exists or not
$fbqExists = $browser->script('return typeof window.fbq !== "undefined"');