I need to add some facebook conversion tracking code, which should go between the <head> tags according to their instructions. What would be the best way to do this on an Umbraco site? I'm new to Umbraco so it's not immediately obvious where to slot it in.
If the facebook conversion tracking code, should be on every page, and it´s the same code I would just added in the master template, if you have one. By having a master template you can add all the markup and stuff that should be on every page.
If you use Razor, and using partial view macros or partial views something like this should be good, if your alias of the textbox multiple is facebookConversionCode
Hope this helps, if you have any other questions related to this subject keep asking and I would try to help. If you have other Umbraco questions, just create a new thread.
Adding facebook conversion tracking code
I need to add some facebook conversion tracking code, which should go between the <head> tags according to their instructions. What would be the best way to do this on an Umbraco site? I'm new to Umbraco so it's not immediately obvious where to slot it in.
Thanks
Hi Alistair and welcome to our,
If the facebook conversion tracking code, should be on every page, and it´s the same code I would just added in the master template, if you have one. By having a master template you can add all the markup and stuff that should be on every page.
If you only want it on a specific page, I suggest, that you add a propery on the document type of the page type. The data type of the field could be a textbox multiple, in there you can add your script and print it on the the pages where the field has content. Documentation for the textbox multiple can be found here: http://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors/Textbox-Multiple
If you use Razor, and using partial view macros or partial views something like this should be good, if your alias of the textbox multiple is facebookConversionCode
If you don´t know about master templates, and document types in Umbraco yet, I would recommend you to take a look at these videos.
http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/introduction/ There are two videos about master templates, but maybe this good to see all of them, since you are new.
Here are some videos about how to work with document types: http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/document-types/what-is-a-document-type/
Hope this helps, if you have any other questions related to this subject keep asking and I would try to help. If you have other Umbraco questions, just create a new thread.
/Dennis
Thank you - I'll check out those videos and see how it goes.
Alistair
is working on a reply...