Tyler Hahn
Tyler Hahn

Reputation: 57

Facebook Pixel Events Firing - Why Script AND URL Modification

I am confused as to why Facebook pixel events require that you both run a script to set a pixel event action and also that you update the pixel URL? Their documentation and example here is confusing and doesnt actually show that you need to update the URL after running a script for an event.

I want to run a purchase event on my nonprofit's donation confirmation page. So I add the script fbq('track', 'Purchase', {'value':'9.99','currency':'USD'}); on the confirmation page, but that doesn't apparently do anything unless I update the pixel img src url to include the same data contained in the fbq function - i.e. &ev=Purchase&cd[value]=9.99&cd[currency]=USD"/>

Can someone help me understand this? I've tried adding that URL, but am having trouble using the javascript variable that holds the value and currency for the transaction in the src url for the pixel img. Facebook pixel chrome extention shows one purchase event on the page, and another failed purchase event - and the actual purchase value and currency arent actually getting passed to facebook - just the fact that the event happened...

Upvotes: 0

Views: 810

Answers (1)

Tushar Vaghela
Tushar Vaghela

Reputation: 1243

FaceBook Pixel script should load with page. This script initialize the Pixel and register pageView event.

After that, If you want to register any activity, which is generated by user event. You send that particular event from available events which can be Purchase, Generate Lead, Add to Cart, Initiate Checkout, Add to Wishlist, View Content, Complete Registration or Some more.

You will not see actual value with Helper as it's sending hashed value.

Upvotes: 0

Related Questions