Filter wc_facebook_pixel_script_attributes doesn't change some events code #1268
Labels
feature: pixel events & conversion tracking
Related to Facebook pixel, events, and conversion tracking.
GDPR
type: enhancement
The issue is a request for an enhancement.
🔎 Isolate the bug
✍️ Describe the bug
I'm trying to fix an issue with my Cookie consent script (managed by Iubenda) that I've discussed here in issue #857 (link to my comment) and #301 (link to my comment). But leaving aside for a moment the reason why I need this (block cookie), I need to change the code around
"<script"
issued by your plugin and for doing this I've found a bug/limitation.My idea is to change the HTML code provided by your script, by changing the filter
wc_facebook_pixel_script_attributes
. But it seems that only some pieces of your HTML code are changed while some events are still using the original code.🚶♀️ Steps to reproduce
Add this function in theme's function.php:
✔️ Expected behavior
At this point I'm expecting that all the Javascript code inserted by your plugin will be changed. But I've found that was only changed the JS load script and the PageView event:
This is fine, but the other events (in page footer) have still the original code with type="text/javascript", example:
🗃 Logs
I have no useful logs to share
Do you have any suggestion on how can I change all the scripts type?
The text was updated successfully, but these errors were encountered: