admin管理员组文章数量:1241124
In my Laravel project, I'm successfully tracking frontend events using the JavaScript code fbq('track', 'PageView')
, which works well for tracking page views.
However, when attempting to use the MetaPixel::track()
method within a Laravel controller, I used the following code:
use Combindma\FacebookPixel\Facades\MetaPixel;
MetaPixel::track('SignIn', [
'User_Email' => $customer->email,
'Status' => 'logged in successfully'
]);
Despite installing all the necessary dependencies and adding the required code in the config file, the event tracking does not seem to function as expected.
<?php
return [
/*
* The Meta pixel id, should be a code that looks something like "1202417153106158".
*/
'pixel_id' => env('META_PIXEL_ID', ''),
/*
* The key under which data is saved to the session with flash.
*/
'session_key' => env('META_PIXEL_SESSION_KEY', config('app.name').'_metaPixel'),
/*
* Only if you plan using Conversions API for server events
* To use the Conversions API, you need an access token. For Documentation please see:
*/
'token' => env('META_PIXEL_TOKEN', ''),
/*
* Enable or disable advanced matching. Useful for adjusting user privacy.
*/
'advanced_matching_enabled' => env('META_PIXEL_ADVANCED_MATCHING_ENABLED', true),
/*
* Enable or disable script rendering. Useful for local development.
*/
'enabled' => env('META_PIXEL_ENABLED', true),
/*
* Enable or disable logging. Useful for debugging.
*/
'logging' => env('META_PIXEL_LOGGING', true),
/*
* This is used to test server events
*/
'test_event_code' => env('META_TEST_EVENT_CODE'),
];
Can anyone help me out, so that i can track my events in laravel
本文标签: How to track Facebook MetaPixel event in laravel phpStack Overflow
版权声明:本文标题:How to track Facebook MetaPixel event in laravel php? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740103704a2224898.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论