Jump to content

can anyone help me place javascript into whmcs?


Recommended Posts

Hi Linda, what is your problem ?

If you have got access to your WHMCS Folder it is very simple.

Goto ../whmcs/templates/your template  open there header.tpl

add your code like here in row 13 should be in most cases in between the <head></head> Tags

image.png.20ea214ab23a55cddba76a4b856c6395.png

save all and test it !!

If you need more information or help send me an Message.

Greetings Christian

Edited by wp4all
Link to comment
Share on other sites

  • 5 weeks later...
On 22/05/2018 at 11:45 AM, wp4all said:

Hi Linda, what is your problem ?

If you have got access to your WHMCS Folder it is very simple.

Goto ../whmcs/templates/your template  open there header.tpl

add your code like here in row 13 should be in most cases in between the <head></head> Tags

image.png.20ea214ab23a55cddba76a4b856c6395.png

save all and test it !!

If you need more information or help send me an Message.

Greetings Christian

Hey Christian

Thank you for that. I do however need to add an additional line of code to make this work correctly.

Step 3

To enable prior consent, apply the attribute "data-cookieconsent" to cookie-setting script tags on your website. Set the comma-separated value to one or more of the cookie categories "preferences", "statistics" and "marketing" in accordance with the types of cookies being set by each script. Finally change the attribute "type" from "text/javascript" to "text/plain". Example on modifying an existing Google Analytics Universal script tag:

cookie.JPG

 

Are you able to tell me where i find such a piece of code in the WHMCS files?

 

Thank you for your help

 

 

Link to comment
Share on other sites

Hi nei,

nowhere you have to copy the code from the cookie site, as it already stands above.

Modifiy the script to your needs and past it in.

You know that you need this passus only if you are using Google Analytics ?

This is needed for the pre Opt in / out solution of the cookie.

If you do not use Analytics you should change your cookie to normal conditions.

Greetings Christian

Link to comment
Share on other sites

On 5/21/2018 at 09:56, creativemac said:

Is there anyone here that is able to help me place a piece of javascript into whmcs? It's a cookie consent form from cookiebot

rather than editing the header.tpl template (which you'll have to repeat after each WHMCS upgrade), it would be simpler to use an action hook...

just create a .php file in /includes/hooks, and paste the code below into it (change the data-cbid value to whatever cookiebot tell you to use) - the hook will automatically add the code to the header - and it will still be there after you update WHMCS. :idea:

<?php

/**
* Cookie Bar
* @author brian!
*/

add_hook('ClientAreaHeadOutput', 1, function($vars) {
    
	return <<<HTML
    
<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" type="text/javascript" async></script>

HTML;
});

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated