Inserting Code Into Drupal Pages

4 replies [Last post]
M.E.Traylor's picture
M.E.Traylor
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 07/09/2010

Greetings all!

I've been configuring my site with Drupal and trying to get all the modules in order and generally poking at everything. I'm having some trouble with both the Share This and Google Analytics module. I've got everything set up except I need to insert some code for each into my site. I tried making a block for the Share This code, but it doesn't seem to be working. The site recommends inserting it in the website html header. I've poked around the installation files, but I'm at a loss as to which file to open and insert it in.

As for GA, it says that I need to insert the code on every page I want tracked. Do I literally need to do this, or can I just put it with the code for some element that shows up with every page? I'm guessing I could put the code in the same area as the Share This code.

I'm imagining some of you tech-savvy Drupal users know what I'm talking about. Could someone talk me through it?

Thanks!

__________________

Guts and Sass: An Anti-Epic

Guts and Sass is the story of when semi-suicidal vet Hannah Roverton gets transported to a magical land, thus abandoning her cat, her sister, and her therapist. Except actually, it’s not. Welcome to a land embroiled in war and invasion with a pinch of magic, meet pirates, shapeshifters, and chicks with swords. Now throw your expectations out the window. Got no heroes, no glory, and it ain’t no lie.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
MeiLin's picture
MeiLin
User offline. Last seen 45 min 9 sec ago. Offline
Joined: 09/20/2009

The GA and ShareThis Drupal modules insert the code automatically. You don't have to do it manually.

__________________

An Intimate History of the Greater Kingdom
WebLit.Us:
Helping the Web Literati Spread the Word by Helping One Another
DigitalNovelists.com: Web Services for WebLit

M.E.Traylor's picture
M.E.Traylor
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 07/09/2010

Hmm. GA is telling me this:

Quote:
Copy and place the code snippet
Once you find the code snippet, copy and paste it into your web page, just before the closing tag*. If your website uses templates to generate pages, enter it just before the closing tag in the file that contains the section. (Most websites re-use one file for common content, so it's likely that you won't have to place the code snippet on every single page of your website.)

I put it in the header of the style.CSS file, and now it claims to be working. I'm still having trouble with ShareThis, though.

I signed up for the ShareThis analytics, and pasted the button code into the field in the ShareThis module configuration. For the second piece of code, the script tag, they instruct:

Quote:
This is your ShareThis script tag, without it the buttons don't work. You can put it anywhere on your page. We recommend putting it in your header (between your and tags)

I put that code in the header of the style.CSS file too, but the buttons are not showing up, just what appears to be a link that says 'ShareThis' but only leads to the same page you're already on.

I'm also sending a note to the ShareThis people, see what else I can discover.

__________________

Guts and Sass: An Anti-Epic

Guts and Sass is the story of when semi-suicidal vet Hannah Roverton gets transported to a magical land, thus abandoning her cat, her sister, and her therapist. Except actually, it’s not. Welcome to a land embroiled in war and invasion with a pinch of magic, meet pirates, shapeshifters, and chicks with swords. Now throw your expectations out the window. Got no heroes, no glory, and it ain’t no lie.

MeiLin's picture
MeiLin
User offline. Last seen 45 min 9 sec ago. Offline
Joined: 09/20/2009

GA and ShareThis instructions are for people NOT using the Drupal modules. Please follow the directions in the Read Me files for the GA and ShareThis modules.

__________________

An Intimate History of the Greater Kingdom
WebLit.Us:
Helping the Web Literati Spread the Word by Helping One Another
DigitalNovelists.com: Web Services for WebLit

M.E.Traylor's picture
M.E.Traylor
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 07/09/2010

Looks like I'm not the only one experiencing trouble with the 6.1.8 ShareThis module. I've tried both the non-Drupal protocol with ShareThis, the latest development release, and the 1.3 version, but I'm not having much luck, so I'm going to try the module Service Links (which is at least showing up).

__________________

Guts and Sass: An Anti-Epic

Guts and Sass is the story of when semi-suicidal vet Hannah Roverton gets transported to a magical land, thus abandoning her cat, her sister, and her therapist. Except actually, it’s not. Welcome to a land embroiled in war and invasion with a pinch of magic, meet pirates, shapeshifters, and chicks with swords. Now throw your expectations out the window. Got no heroes, no glory, and it ain’t no lie.

Recent comments

Who's new

  • jasimine957
  • wholesaleeuropeancup
  • AliciaWorkman
  • mrjersyes44
  • xiaoebw6
  • chrisjaybecker
  • Soccer Jerseys ...

Who's online

There are currently 0 users and 1 guest online.