Google Analyticsで携帯サイトのアクセス解析を設置。(PHPをSSIにて利用)

| | カテゴリ : SEO , サイト制作 , 携帯 | コメント(95) | トラックバック(0)
このエントリーをはてなブックマークに追加  

無料のアクセス解析「Google Analytics」携帯サイトのアクセス解析で、HTMLファイルにてSSIを利用してPHPをインクルードできたのでご紹介。


SSIをHTMLで読み出す場合、.htaccess等に
以下を追加し、PHPと同じディレクトリに置きます。


AddHandler server-parsed html


次にGoogle Analytics Now More Powerful, Flexible And IntelligentのExpanded Mobile Reportingの「download snippet instructions」よりファイルをダウンロード。PHPフォルダ内を利用します。


・ga.phpをルートディレクトリに設置。


・php1.snippet内にあるコピーし、別名でphpファイルに。ファイルをエディターで開き、GA_ACCOUNTのところを取得している「UA-XXXXXXXXX」を「MO-XXXXXXXXX」に変えます。


以下になるようにします。


<?php
// Copyright 2009 Google Inc. All Rights Reserved.
$GA_ACCOUNT = "MO-XXXXXXXX";
$GA_PIXEL = "/ga.php";

function googleAnalyticsGetImageUrl() {
global $GA_ACCOUNT, $GA_PIXEL;
$url = "";
$url .= $GA_PIXEL . "?";
$url .= "utmac=" . $GA_ACCOUNT;
$url .= "&utmn=" . rand(0, 0x7fffffff);
$referer = $_SERVER["HTTP_REFERER"];
$query = $_SERVER["QUERY_STRING"];
$path = $_SERVER["REQUEST_URI"];
if (empty($referer)) {
$referer = "-";
}
$url .= "&utmr=" . urlencode($referer);
if (!empty($path)) {
$url .= "&utmp=" . urlencode($path);
}
$url .= "&guid=ON";
return str_replace("&", "&", $url);
}
?>
<?php
$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
print ("<img src=\"$googleAnalyticsImageUrl\" width=\"1\" height=\"1\" alt=\"\" />");
?>


※ga.phpが呼べるようパスを確認しましょう。


最後に</body>前に上記のPHPを呼ぶように以下のコードを設置します。


<!--#include virtual="/ファイル名.php"-->


※保存したパスも確認をしましょう。データ取得まで1日待ちます。取得が可能かと思います。正式版までこちらで対応が可能かと思います。


※PHP4では動作しない模様です。PHP5以上が必須のようです。注意が必要です。

トラックバック(0)

このブログ記事を参照しているブログ一覧: Google Analyticsで携帯サイトのアクセス解析を設置。(PHPをSSIにて利用)

このブログ記事に対するトラックバックURL: http://takot.sakura.ne.jp/mt/mt-tb.cgi/1210

コメント(95)

こんにちは。

自分も設置してみたのですが、ログが取れていない様子。

※PHP4では動作しない模様です。PHP5以上が必須のようです。注意が必要です。

とありますが、どこからの情報ですか?
自環境はPHP4です。。。。

ちなみに、以前試したこちらのライブラリでは成功しました。
http://eos.exbridge.jp/projects/show/ga4k

宜しくお願いします。

ゴエモンさん、コメント有難うございます。

PHP4で試して動作しなかったので動かないかと。
特に何処かの情報ではありません。

正式リリースまで詳細の情報を待つしかないと思います。

I am really impressed with your writing skills and also with the
layout on your blog. Is this a paid theme or did you customize
it yourself? Anyway keep up the excellent quality writing, it's rare to see a
great blog like this one nowadays.

Hello, i feel that i noticed you visited my weblog thus i got here to return the
choose?.I am attempting to find things to improve my site!I assume its
ok to use a few of your concepts!!

Pretty component of content. I just stumbled upon your web site and in accession capital
to assert that I acquire actually loved account your blog posts.

Any way I will be subscribing on your feeds and even I achievement
you access persistently fast.

We are a group of volunteers and opening a new scheme in our community.
Your website offered us with valuable information to work
on. You have done a formidable job and our entire community will be grateful to you.

Just want to say your article is as surprising. The clarity in your post is just nice and i can assume you
are an expert on this subject. Fine with your permission let me to grab
your RSS feed to keep up to date with forthcoming post.
Thanks a million and please continue the gratifying work.

WFAA-Tv Channel 8 stories that native sheriff deputies had been on the scene earlier than the taking
pictures befell responding to illegal parking, and that the venue had private safety
guards but that none of them were in a position to return fire.

The taking pictures befell at what Hunt county sheriff Randy Meeks described as a Halloween and homecoming occasion, although officials said it was not a faculty-sanctioned occasion. The taking pictures
happened at an 8,000-sq.-meter event area known as The Party Venue, which was holding a Halloween celebration called "Twerk or Tweet"
to mark the top of the university’s homecoming week.

Outside the venue, Halloween masks and different debris have been strewn about.
Fake bullets have been found on the flooring of The Party Venue, however
Meeks stated they had been probably a part of a Halloween costume.
Two individuals were killed and 6 others wounded when a shooter opened fireplace at an off-campus homecoming party
near Texas A&M University-Commerce campus simply earlier than midnight. https://commerceinntexas.com/

It's really a great and useful piece of info.
I am satisfied that you simply shared this useful information with
us. Please stay us up to date like this. Thanks for sharing.

writing an apa paper https://writemypaperhelper.com/ research paper writers
write research paper for me

Right now it looks like BlogEngine is the best blogging platform available right now.
(from what I've read) Is that what you are using on your
blog?

Today, I went to the beach with my kids. I found a sea shell annd
gave it to my 4 year oldd daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and
screamed. There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this iis entirely off topic but I had to tell someone!

Aromatase blockers price buuy pharmaceuticals Ukraine letrokzole price

We're a group of volunteers and starting a new scheme in our community.
Your website offered us with valuable info to work on. You've done a formidable job and our whole community will be
grateful to you.

This excellent website truly has all of the
info I needed concerning this subject and didn't know who to ask.

Thank you for the good writeup. It in fact was a amusement account it.
Look advanced to more added agreeable from you!
By the way, how could we communicate?

I think the admin of this web page is truly working hard
in support of his website, for the reason that here
every data is quality based material.

hello there and thank you for your info – I have definitely
picked up anything new from right here. I did however expertise a few technical issues
using this website, as I experienced to reload the site many times previous to Icould get it to load properly.
I had been wondering if your hosting is OK? Not that I am complaining, but sluggish loading instances times will sometimes affect your placement in google and coukd damage your quality score if ads and marketing
with Adwords. Anyway I am adding this RSS to my email and could look out for a lot more of your respective intrikguing content.

Make sure you update this again very soon.

Hi there, just became aware of your blog through Google,
and found that it is really informative. I'm gonna watch out
for brussels. I'll appreciate if you continue this in future.
A lot of people will be benefited from your writing.
Cheers!

digimon data squad game online free
https://linkeddating.ehotely.eu
digimon data squad game online free
cowgirl dating website

dating an inmate website
https://onthedocks.eu
dating an inmate website
sending pictures online Dating

Those who had formerly never ever truly troubled to sit down with a pen to fill out a typical
crossword challenge, now find themselves really enjoying crossword games online since they're easy
to submit as well as a lot of fun.

Thanks a bunch for sharing this with all of us you actually understand what you're talking approximately!

Bookmarked. Kindly additionally seek advice from my website
=). We may have a link alternate agreement among us

Do you mind if I quote a couple of your articles as long as I provide credit
and sources back to your website? My blog site is in the very same niche as yours
and my users would really benefit from some of the information you provide here.
Please let me know if this ok with you. Cheers!

Hey there! I'm at work surfing around your blog from my new iphone!
Just wanted to say I love reading through your blog
and look forward to all your posts! Keep up the superb work!

Nice post. I learn something new and challenging on blogs I stumbleupon every day.
It's always helpful to read through articles from
other writers and practice something from their web sites.

best way to get a response online dating
http://datingform.phytolite.eu/
best way to get a response online dating
most popular sex dating sites

single parent dating app uk
https://usdatingsitesfree.web-director.eu
single parent dating app uk
single parent dating app uk

Fantastic website. A lot of helpful info here. I'm sending it to a
few friends ans also sharing in delicious.
And of course, thank you on your effort!

Wow, that's what I was searching for, what a material!

existing here at this website, thanks admin of this web page.

You made some good points there. I checked on the web to find out more about the issue and found most individuals will go along with your views on this web site.

Pretty nice post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your blog posts.

In any case I'll be subscribing to your feed and I
hope you write again very soon! https://www.timbuljayamotor.com/why-is-it-extremely-essential-to-address-a-lice-outbreak/

Have you ever thought about including a little bit more than just your articles?
I mean, what you say is fundamental and everything.
But just imagine if you added some great pictures or videos to give your posts more, "pop"!
Your content is excellent but with images and video clips,
this website could definitely be one of the greatest in its field.
Superb blog!

Hi i am kavin, its my first occasion to commenting anyplace, when i read
this post i thought i could also create comment due to this sensible post. https://dnauctioneer.com/all-about-pure-oils-that-provide-pure-sun-protection/

Hi there! I know this is kinda off topic but I'd figured I'd ask.
Would you be interested in trading links or maybe guest writing a blog article or vice-versa?
My website discusses a lot of the same subjects as
yours and I think we could greatly benefit from each other.

If you happen to be interested feel free to shoot me an e-mail.
I look forward to hearing from you! Wonderful blog by the
way!

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this.
Please let me know if you run into anything.
I truly enjoy reading your blog and I look forward to your new updates.

Hello, I think your site might be having browser compatibility
issues. When I look at your blog in Opera, it looks fine but when opening in Internet Explorer, it has some
overlapping. I just wanted to give you a quick heads up!

Other then that, terrific blog!

Hi there! This is my first comment here so I just wanted to give a quick shout out
and say I really enjoy reading through your posts. Can you recommend any
other blogs/websites/forums that go over the same topics?
Many thanks!

Hello! This is kind of off topic but I need some advice from an established blog.
Is it hard to set up your own blog? I'm not very techincal but
I can figure things out pretty quick. I'm thinking about setting up my own but I'm not sure where to begin. Do you have any ideas or suggestions?

Thank you http://topwow.hu/index.php?a=stats&u=sofiahatchett1

Hey there, I think your site might be having browser compatibility issues.
When I look at your website in Chrome, it looks fine but
when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, awesome
blog!

Hi there everyone, it's my first pay a visit at this web site, and paragraph is genuinely fruitful in favor of me, keep up posting these
articles. https://dnauctioneer.com/what-of-morganucodon-itself-3/

Hello there Good Blog you may have on this page, it
seems like you set plenty of work in it. Internet marketing just exploring some Blog to have ideas for my Web
site. I offer Bongs on the market, and also a nice Neighborhood on my webpage.

If you're interested in Bongs for Sale, or just a Bong Onlineshop, remember to check me out and then leave me a submit.


br, Moe

Thank you for some other wonderful article. Where else may just anybody
get that kind of information in such an ideal approach of writing?
I've a presentation next week, and I'm at the look for such information.

Greetings from California! I'm bored to tears at work so I decided to check out
your site on my iphone during lunch break. I love the information you present here and can't wait to
take a look when I get home. I'm amazed at how quick your blog loaded
on my cell phone .. I'm not even using WIFI, just 3G .. Anyways, wonderful site!

I know this if off topic but I'm looking into starting my own blog
and was wondering what all is required to get set up?
I'm assuming having a blog like yours would cost a pretty penny?
I'm not very internet smart so I'm not 100% certain. Any
tips or advice would be greatly appreciated.
Appreciate it

I beloved up to you'll receive performed right here.

The comic strip is tasteful, your authored material stylish.
however, you command get bought an impatience over that
you wish be handing over the following. ill definitely come further formerly again since precisely the same nearly very
frequently inside of case you protect this increase.

I am just commenting to let you be aware of what a extraordinary
experience my wife's princess developed using yuor web blog.
She figured out a lot of details, which include how it is like to have an ideal coaching heart to get other
individuals without problems gain knowledge of certain complex matters.
You undoubtedly exceeded my expectations. I appreciate you for presenting such priceless,
trustworthy, explanatory as well as fun thoughts on your topic to
Jane.

If you would like to grow your knowledge only keep visiting this website and be updated with the newest gossip posted here.

Hello there there Very good Blog you have on this page, it feels as
though you place a great deal of are employed in it.
Im just looking at some Blog to have ideas for my
Site. I offer Bongs available for sale, and also a good Group on my small site.
If you're interested in Bongs available for sale, or perhaps a Bong Onlineshop, make
sure you check me out leaving us a post.

br, Moe

An impressive share! I have just forwarded this onto a friend who has been doing a little homework on this.
And he in fact bought me lunch simply because I found it for him...
lol. So let me reword this.... Thank YOU for the meal!!
But yeah, thanks for spending some time to talk about this subject here on your blog. https://uricasino114.com

Hello there! I just want to give you a huge thumbs up for the excellent information you have got here on this post.

I'll be returning to your site for more soon.

Very nice post. I just stumbled upon your blog and wanted to mention that I've
really loved browsing your blog posts. After all I'll be subscribing to your
feed and I am hoping you write again very soon!

Hey terrific website! Does running a blog such as this require a lot of work?
I've very little knowledge of programming but I was hoping to
start my own blog soon. Anyways, should you have any
suggestions or tips for new blog owners please share.
I know this is off topic nevertheless I simply had to ask.
Thanks a lot!

We're a group of volunteers and opening a new scheme in our community.
Your website offered us with valuable information to work on. You have done
an impressive job and our entire community will be grateful
to you. http://crimea.edgestile.ru/take-pleasure-in-month-to-month-insights-into-palaeoart-and-fossil-animal-biology/

Hmm is anyone else experiencing problems with the pictures on this
blog loading? I'm trying to find out if its a problem on my end or
if it's the blog. Any responses would be greatly appreciated.

This is a really good tip especially to those new to the blogosphere.
Short but very accurate information… Thanks for
sharing this one. A must read post!

I'm not sure why but this blog is loading incredibly slow for
me. Is anyone else having this issue or is it a issue on my end?
I'll check back later and see if the problem still exists.

I simply couldn't leave your web site before suggesting that I extremely loved the standard information a person provide on your
visitors? Is going to be again often to investigate cross-check new posts

Excellent way of explaining, and pleasant post to take data regarding my presentation subject matter,
which i am going to present in institution of higher education.

Hello there, just became alert to your blog through Google, and found that it's truly
informative. I am gonna watch out for brussels. I'll be grateful if you continue this in future.
A lot of people will be benefited from your writing. Cheers!

But wanna comment on few general things, The website layout is perfect, the articles is very good :
D.

Hi, i read your blog from time to time and i own a similar one and i was just
curious if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you
can suggest? I get so much lately it's driving me mad so any support is very much appreciated.

Hello there! Quick question that's completely off topic.
Do you know how to make your site mobile friendly? My
web site looks weird when browsing from my apple iphone.
I'm trying to find a template or plugin that might be
able to resolve this problem. If you have any suggestions, please share.
Thank you!

Nice blog right here! Also your website rather a lot up
fast! What web host are you the usage of? Can I
get your affiliate link on your host? I want my web site loaded up
as fast as yours lol

I have learn some good stuff here. Certainly value bookmarking for revisiting.
I surprise how much attempt you place to make one of these great
informative web site.

Thanks for the good writеup. It in reаlity was a entertainment
account іt. Look complicated to more delivered agreeable
from you! Howeveг, how could we be in contact?

I think the admin of this site is truly working hard in support of his web site, because here every stuff
is quality based information.

What i don't understood is if truth be told how you're no longer actually a lot more
smartly-favored than you might be now. You're so intelligent.
You already know therefore significantly when it comes
to this subject, produced me in my view consider it from so many numerous angles.
Its like women and men aren't interested except it is one thing to do with Girl gaga!
Your own stuffs outstanding. All the time maintain it up!

Usually I do noot learn article on blogs, but I would like to
say that this write-up very pressured me to take a look at and do it!
Your writing style has been surprised me. Thanks,
quite nice post.
бесплатные онлайн-игры казино web page casino official website

At this time it appears like Wordpress is the best blogging platform available right
now. (from what I've read) Is that what you are using on your blog?

Nice post. I was checking continuously this weblog and I'm inspired!
Very useful info specially the ultimate section :) I take care of such information a lot.

I was looking for this certain information for a very lengthy time.
Thanks and best of luck.

Link exchange is nothing else except it is just placing the other person's weblog link on your page at suitable place and other
person will also do similar for you.

whoah this blog is fantastic i like studying your articles.
Keep up the good work! You realize, lots of individuals are hunting around for this info, you could help them
greatly.

I'm gone to inform my little brother, that he
should also pay a quick visit this weblog on regular basis to take updated from most up-to-date
information.

I conceive you have remarked some very interesting details, thanks for the post.

I like your writing style genuinely loving this site.

Hey very nicce web site!! Guy .. Beautiful .. Wonderful ..
I'll bookmark your site and tale the feeds also? I'm happy to find numerous helpful info here in the publish,
we'd like work out more strategis in this regard, thank you ffor sharing.
. . . . .
web sire parimatch

I like this web site very much, Its a rattling nice situation to read and receive information.

Hiya, I am really glad I've found this info. Today bloggers publish only about gossips and web and this is actually irritating.
A good website with interesting content, that is what I need.
Thanks for keeping this site, I'll be visiting it.
Do you do newsletters? Can not find it.

Thank you, I have just been looking for information approximately
this subject for ages and yours is the best I have discovered till now.
However, what in regards to the conclusion? Are you sure in regards to the supply?

Good day! This is kind of off topic but I need some guidance from an established blog.
Is it very difficult to set up your own blog? I'm not very
techincal but I can figure things out pretty fast.
I'm thinking about setting up my own but I'm not sure where to start.
Do you have any tips or suggestions? Thank you

great issues altogether, you just gained a brand new reader.
What may you suggest in regards to your publish that you just made a few days in the
past? Any positive?

Howdy! I understand this is sort of off-topic however I had to ask.
Does operating a well-established blog like yours take a massive amount work?
I'm completely new to writing a blog but I do write in my diary every
day. I'd like to start a blog so I can share my personal experience and views online.
Please let me know if you have any kind of suggestions or tips for new aspiring bloggers.
Appreciate it!

I for all time emailed this blog post page to all my associates, for the reason that if like to rewd it after tbat my contacts will too.


site продвижение сайта в интернет раскрутка и продвижение сайта

Howdy I am so thrilled I found your blog page, I really found
you byy mistake, while I was looking onn Digg for something else, Anyhow I am here now and would just like
to say kdos for a fantastic post and a all round entertainhing blog
(I also love the theme/design), I don’t have time tto read through it all at the moment but I have book-marked it and also added your
RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the great b.


web page website promotion SEO promotion

I think other web-site proprietors should take this web site as an model, very clean and
great user friendly style and design, let alone the content.
You're an expert in this topic!

Hello there! Do you know if they make any plugins to assist with Search Engine Optimization? I'm
trying to get my blog to rank for some targeted keywords but I'm not seeing very
good results. If you know of any please share. Thanks!

Write more, thats all I have to say. Literally, it seems as though you relied on the video to
make your point. You obviously know what youre talking
about, why waste your intelligence on just posting
videos to your blog when you could be giving
us something informative to read?

Appreciate the recommendation. Will try it out.

web page website promotion and prommotion website promotion price

Great information it is really. My teacher has been looking for
this tips.

I couldn't resist commenting. Exceptionally well written!

I know this if off topic but I'm looking into starting my own blog and was curious what
all is needed to get set up? I'm assuming having a blog like yours would cost a
pretty penny? I'm not very web savvy so I'm not
100% sure. Any suggestions or advice would be greatly appreciated.
Kudos

Your style is so unique compared to other folks I have read stuff from.
Many thanks for posting when you have the opportunity, Guess I'll
just bookmark this site.

Today, while I was at work, my sister stole my iPad and testeed to
seee if it can survive a 30 foot drop, jyst so she
caan be a youttube sensation. My iPadd is now destgroyed and
she has 83 views. I knokw this is entirely off topic but I had to share it with
someone!
site websiite prromotion SEO website promotion website promotion

Its like you read my mind! You seem to know a lot about this, like you wrote the book in it
or something. I think that you could do with a few pics to drive the message home a little bit, but
instead of that, this is magnificent blog. A fantastic read.
I'll definitely be back.

Hey there! Do you know if they make any plugins to safeguard against hackers?
I'm kinda paranoid about losing everything I've worked hard on. Any tips?

コメントする

Insert Emoddy tag

画像の中に見える文字を入力してください。

プロフィール

Kamitani79
ニックネーム : Kamitani79
映画鑑賞、音楽、写真、ゲーム。地元・横浜をこよなく愛する( `・∀・´)ノヨロシク
自己紹介 :
このエントリーをはてなブックマークに追加

携帯サイト

つながり

  • ブロガー(ブログ)交流空間 エディタコミュニティ
  • あわせて読みたいブログパーツ
  • フィードメーター - Kamitani79-メロンとバナナとブログ
  • SEO
    loading
Creative Commons License
このブログのライセンスは クリエイティブ・コモンズライセンス.
Powered by Movable Type 6.2.4

最近のアクション

人気のエントリー

最近の写真・画像

空の写真

www.flickr.com
This is a Flickr badge showing public photos and videos from Kamitani79. Make your own badge here.

このブログ記事について

このページは、Kamitani79が2009年11月 4日 22:53に書いたブログ記事です。

ひとつ前のブログ記事は「ついにMovable Type 5の出荷日が決定」です。

次のブログ記事は「Britney Spearsの新曲「3」いいね。 」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。