Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

New Facebook Pixel and Standard Events

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi everybody!

I was wondering about New Facebook pixel script placement.
I know in each template there is a section for adding the code.
At the moment in my site I have two different templates,
the Newstream2 here: fairfashion.it/it/parrucche/
and the Medica here: fairfashion.it/it/hair-extension

As stated here www.facebook.com/business/help/952192354843755
the new facebook pixel should be installed in all the pages by adding the code between head and head.
But the Facebok Standard Events should be placed only on the page I want to track on my facebook ads
How do I accomplish to install both the facebook pixel AND additional Standard Events if:
I use two templates
I would like to use the Standard Events

Any suggestion?
Thanks to all and have a god day!
Simone
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
The administrator has disabled public write access.
Hi,

For the code that needs to go on all pages in the head of the document, you can add it to the custom script areas in both pages.

The script that you want to use on selective pages you would need to add using a module or plugin.
There are a few available that let you add custom scripts which you could then assign to the debug module position.

You could also just add that code in the same way as you are inserting the adverts so the code shows at the same time as the adverts you want to track.

Regards,

Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
Hi Rob,

thanks
1 regarding the main script on both the templates, you mean that each template has its own <head>, so the script even if it is the same, has to be copied on both right?

2 regarding the facebook standard events, I guess they are scripts that are included in the main pixel script:
www.facebook.com/business/a/add-pixel-standard-events
by adding them separately in a module, do you think they work.
I don't understand your:
"You could also just add that code in the same way as you are inserting the adverts so the code shows at the same time as the adverts you want to track."
The ads will be on facebook and will send traffic on the site, so the standard events are a way to monitor how the ads on facebookare performing.
thanks
Simone
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
The administrator has disabled public write access.
1. If adding via the template settings you need to add it to each instance of the template. If adding to the files it's just added to one file: tpls/blocks/head.php

2. I think Rob meant that you could add the scripts so that they only appear on pages that require them. That way you don't unnecessarily load the scripts on pages not showing that content.

Thanks
  • Anthony Olsen's Avatar
  • Anthony Olsen
  • LIfetime Developer - Big Bamboo
  • 23925 posts
  • 788 Thanks
  • Karma: 433
The administrator has disabled public write access.
Hi Anthony,

1 I understand.
Each templates uses its own head.php in tpls/blocks/
or I just put in the respective code section in the template settings of every instance.OK

2 I understand that the Facebook standard events code has to be included in the main facebook pixel code which is in the "head" section.
www.facebook.com/business/a/add-pixel-standard-events
By adding it as html custom module in each page it is not in the head section, is it in the "body" section right?

I found something I'm looking for in wordpress:
wordpress.org/plugins/pixelyoursite/screenshots/
on the second screenshot this plugin lets you put the Facebook standard events code only on the page you need.

How can I accomplish to have custom "head" in different pages in Joomla?

regards
Simone
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
Last Edit: 8 years 1 month ago by simone.stefanini.
The administrator has disabled public write access.
Hi Simone,

Have you tried the joomla extension directory?

extensions.joomla.org/

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
And a quick google search came up with

extensions.joomla.org/extension/headtag
extensions.joomla.org/extension/easyscript

I've not used either of these extensions but may be worth a look

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,

I sure have to take a look there, my questions were just to understand how joomla works with the head and body. I'm a novice in this kind of things.
So you all confirm is possible to have different "head" for different pages (ItemID) in joomla? And that is achievable only with extensions?
thanks
Simone
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Simone,

It's not something I've had to do but as Rob said

"The script that you want to use on selective pages you would need to add using a module or plugin."

and

"You could also just add that code in the same way as you are inserting the adverts so the code shows at the same time as the adverts you want to track."

So in answer to your question that would be yes, to add selectively to pages you would need to use an extension

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Ok thanks I'll try with one extension. Simone
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
The administrator has disabled public write access.
Good luck with it :)

Enjoy the weekend

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Everybody,
I found a way to get the facebook script I need in the "head" thanks to a module (called blank module), but now it's doubled!! (pls see screenshot attached)
It's already there because I added it in the template configuration. Notice that there is a small difference circled in green that has to be only on some pages.
Is there a way to exclude some pages when adding this script via the template settings?
Thanks Simone



File Attachment:

File Name: afterblankmodule.zip
File Size: 362 KB
  • simone.stefanini's Avatar
  • simone.stefanini
  • 12 Month basic
  • 6 posts
  • Karma: 1
The administrator has disabled public write access.
Hi Simone,

Not using the template settings I'm afraid

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers