Jump to content
thirty bees forum
  • 0

How to add custom code in <header></header>to CMS page?


Question

Posted

Hi,

I'm trying to figure out how I can put custom code in the <header></header> section of a CMS page. I need to add a code event snippet for google adwords tracking, in which the event is clicking on a button on that CMS page:

Copy the snippet below and paste it in between the <head></head> tags of the page(s) you'd like to track, right after the global site tag. Then, call gtag_report_conversion when someone clicks on the chosen link or button.

I also don't exactly understand what is ment by 'Then, call gtag_report_conversion when someone clicks on the chosen link or button.' 

Hope somebody knows?

Kind regards,
Patrick

 

3 answers to this question

Recommended Posts

  • 0
Posted

Hi,

I think the easier way for you will be to edit header.tpl file from your theme.

just before the closing </head> tag you can add.

{if $page_name == 'cms'}
  {literal}
  ... the script you received from google .... 
  {/literal}
{/if}

gtag_report_convertion is probably a function that comes with the google code.

so you should call (run/fire) that function on your desire click event (like clicking a url or a button).

you can see samples here: https://support.google.com/google-ads/answer/6331304?hl=en

the 'on_click' part you will have to put in the content of the page (in the cms page editor).

Good luck

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...