0

I am using drupal as a CMS for one of my client site. He don't have FTP details and even admin details. He has only user details.

I would like to add my Google analytics code in my drupal site? How to add the code without using google analytics module or editing page.tpl.php

something, i would like to implement by using blocks. tell me how can i implement this.

My version: drupal 6.2.8

2
  • FTP? Do you have access to cpanel and files? You can add the code to main template file depending on the core version you are using! Commented Aug 13, 2013 at 12:55
  • I don't have access to FTP, that is problem i have.I try to explain with clients, but he can't understand. any other way to add Google Analytics? Commented Aug 19, 2013 at 10:17

2 Answers 2

1

didn't you just answer your own question? put it in a block and set the block to a footer region or something?

Sign up to request clarification or add additional context in comments.

3 Comments

yes, i did created a blocka in the name of "Google Analytics" and added in footer region. What it happens in front end it display the full code. It not support the javascript in that blcok. how can i place the code. i tried many times? no luck
Enable php filter core module and use this format for the custom block. Otherwise <script> will be disabled.
Yes, i enabled that module too by tick mark and saved. still it not worked. But in the module section the enable module are showing green color like this (enabled) but for PHP filter it not showed like this. any other way.
0

Drupal is based on twig templates. So you can use the twig syntax for adding script. If you but the code into page.html.twig, all pages using this standard layout. Not a perfect solution but it works.

{% block javascripts %} <script src="..."></script> {% endblock %} 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.