最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to verifyassert that Facebook Pixel track events are actually working using laravel dusk? - Stack Overflow

programmeradmin4浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

I'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"');

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论