Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Google Analytics module


Guest

Recommended Posts

Sorry for multiple replies.

 

It appears there may be a problem because google instructions say:

 

<body onLoad="java script:__utmSetTrans()">

 

should be BELOW the standard tracking code.

 

The footer is above the analytics.php inclusion, but if you placed the code in the footer, it would not be above this body onLoad instruction.

 

I'm not certain that it makes a difference, but I haven't installed the ecommerce tracking code into my site yet. I, too, put the standard tracking code into footer.php.

 

Note that "javascript" should be one word in the body tag.

 

If I have a few minutes this evening, I'll set up the ecommerce tracking stuff and see if it works with the standard tracking info in the footer.

 

--Glen

Edited by SteveDallas
Link to comment
Share on other sites

  • Replies 389
  • Created
  • Last Reply

Top Posters In This Topic

Guyz I need hep with this contribution.

 

I had google analytics installed before I installed this contrib and it is working ok, The "normal" analytics.

 

Then I uploaded the analytics.php file, added the javascript into the chekout_sucess.php, enabled the e-commerce in google and removed my ip filter.

 

I have no ide, what Ive done wrong.

 

Im posting my checkout_sucess.php if someone can look into it.

 

Thanks

<?php

/*

$Id: checkout_success.php,v 1.49 2003/06/09 23:03:53 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the shopping cart page

if (!tep_session_is_registered('customer_id')) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {

$notify_string = 'action=notify&';

$notify = $HTTP_POST_VARS['notify'];

if (!is_array($notify)) $notify = array($notify);

for ($i=0, $n=sizeof($notify); $i<$n; $i++) {

$notify_string .= 'notify[]=' . $notify[$i] . '&';

}

if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);

 

tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);

 

$breadcrumb->add(NAvb script:__utmSetTrans()">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="4" cellpadding="2">

<tr>

<td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>

<td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?><br><br>

<?php

if ($global['global_product_notifications'] != '1') {

echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">';

 

$products_displayed = array();

for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {

if (!in_array($products_array[$i]['id'], $products_displayed)) {

echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>';

$products_displayed[] = $products_array[$i]['id'];

}

}

 

echo '</p>';

} else {

echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER;

}

?>

<h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td>

</tr>

</table></td>

</tr>

<?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

 

<?php

// osCoders.biz - Analystics - start

include(DIR_WS_MODULES . 'analytics/analytics.php');

// osCoders.biz - Analistics - end

?>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Yeah, your right. I was so into giving you all the info, that I forgot the most important one.

 

Well the problem is that google analytics is not showing any shopping info. All the "normal" visiting stats are still being desplayed as before, but the "new" e-commerce info is not being recorded.

 

P.

Link to comment
Share on other sites

Yeah, your right. I was so into giving you all the info, that I forgot the most important one.

 

Well the problem is that google analytics is not showing any shopping info. All the "normal" visiting stats are still being desplayed as before, but the "new" e-commerce info is not being recorded.

 

P.

 

check in your Google control panel that you have enabled the ecommerce option maybe?

Link to comment
Share on other sites

Done, Ive done that in the start

 

P.

 

if you have installed it recently, be aware that transactions are recorded with a 24h delay.

If not, read my post on page 6 of this thread

Edited by pixclinic
Link to comment
Share on other sites

if you have installed it recently, be aware that transactions are recorded with a 24h delay.

If not, read my post on page 6 of this thread

 

Well, Its installed for 3 dayz now, so it should be allready working...

 

Ive done all the things from oyur post before asking here.

The only difference is, that I dont have the analytics code in every file. I just puted it into bottom file and it works for me.

 

Could that be a problem?

 

P.

Link to comment
Share on other sites

Well, Its installed for 3 dayz now, so it should be allready working...

 

Ive done all the things from oyur post before asking here.

The only difference is, that I dont have the analytics code in every file. I just puted it into bottom file and it works for me.

 

Could that be a problem?

 

P.

 

If the only differences between your analytics and mine are :

- yours is not working

- yours doesn't have the javascript between the head tags

 

bottom line ;-) ?

Link to comment
Share on other sites

If the only differences between your analytics and mine are :

- yours is not working

- yours doesn't have the javascript between the head tags

 

bottom line ;-) ?

 

Thats the logical way of thinking that even I get :D

 

Its 1am, so, Ill get to it tomorow and report.

Thanks and have fun

 

P.

Link to comment
Share on other sites

  • 2 weeks later...

This thing is killing me!

 

I have sts 2.2

 

I have my tracker working just fine with brining in the data i need like how many visits

 

 

now ecommerce has no data. obvisouly with sts, body tag of the checkout success are ignored. cant i try a small pixel image and have the onload command on that.

 

please if someone has it working. please list the steps i need for google analytics to work with sts templates.

Link to comment
Share on other sites

Looks a top notch install. Just a few quick questions.

 

1. Should anythign show up in the admin / modules are on the back end of the site?

 

2. Is there a list of recommended pages to add the PHP code to.

 

3. Can I not just add the code to the header and it would pick up traffic that way or would that lead to misleading results as it would be reloading the JS all the time?

 

TIA

Things still to do before going "live" in no real order...

Change "buy now buttons" css styles

Change "lets see what we have here" into something meaningfull

Main logo of the website

Sort out currency to make site UK only (at present)

Remove "xx requests since" stuff

Update mainpage :D

Move shopping cart status into header

Add in stock status to product listing page

Define styles for product listing standardisation

Change CSS background for Headings

Increase Category size headings

Used mods so far:- basic_design_pack1mk7 | Google XML sitemap w admin | Paypal IPN v 1.2 | Feedmachine | pricematch_1_3_1 | Dynamic Sitemap 1.6 | Whos online Enhancement | Easypopulate 2.72

 

Each one that I solve I;ll be putting a post on the forum in a "completed shop" thread that Im writing up

Link to comment
Share on other sites

Looks a top notch install. Just a few quick questions.

 

1. Should anythign show up in the admin / modules are on the back end of the site?

 

Nothing is visible from the back end, everything happens in Google!

 

2. Is there a list of recommended pages to add the PHP code to.

 

All the pages that are in the root AND that render HTML (just above the </head> tag.

You may decide that you don't want to track some pages like logoff.php or cookie_usage.php, and just track the main pages like index, product info, and the checkout pages. It really depends on the extend of the marketing analysis you are willing to do.

 

 

3. Can I not just add the code to the header and it would pick up traffic that way or would that lead to misleading results as it would be reloading the JS all the time?

 

You may try that, but there is no guarantee that e-commerce tracking will work correcctly. Visits will be tracked correctly, but I noticed that my conversions were not tracked correctly before I moved the "urchin part" between head tags, and not in the header.php

Edited by pixclinic
Link to comment
Share on other sites

Hi pixclinic

 

You mentioned in a previous post you where testing if it was better to put

 

https://www.mysite.com/checkout_success.php?

 

or

 

/checkout_success.php?

 

Which is better? I think it was to do with lossing referal data.

 

Also I think you wrote \ /checkout_success.php? was the extra \ a typo?

 

I don't understand the question

please explain what you are doing :-)

Link to comment
Share on other sites

By the way, when you define your purchase goal to the checkout_success.php, a good idea is the enter the

STEM of the url instaed of the full one. Refer to help>tracking central>troubleshooting tracking>why isn't goole ytacking my goals, and take a look at the paragraph called: "you're using an exact match..."

 

I entered today /checkout_success\.php? as my goal URL instead of the absolute one. Let's see if it makes a difference..

 

oops, :-" :rolleyes: :D sorry I meant when setting your "Conversion Goals and Funnel" urls. It was about a post you made which Ive quoted above.

 

So should I change:

 

https://www.mysite.com/checkout_success.php?

 

to

 

/checkout_success\.php? (including the \ ?)

 

Thanks

Edited by Caios
Link to comment
Share on other sites

oops, :-" :rolleyes: :D sorry I meant when setting your "Conversion Goals and Funnel" urls. It was about a post you made which Ive quoted above.

 

So should I change:

 

https://www.mysite.com/checkout_success.php?

 

to

 

/checkout_success\.php? (including the \ ?)

 

Thanks

 

the backslash is either a typo because I was tired, or a mesure of protection taken by the forum (same thing as when you write the word javascript, an additional space is added between java and script

 

anyway, my actual settings in GA include the entire url, with domain.

 

However, I'm still not happy with the way referrers are tracked for the conversions: I can only see goals achieved my my own domain (meaning I cannot see if a Google search on the keyword "blahblah" brought me $41 - which was supposed to be the entire point of Analytics. All external referers stay at zero.)

 

If somebody can see goals conversion with other domains than the self, LET ME KNOW, I am interested !

 

Thanks

Edited by pixclinic
Link to comment
Share on other sites

Hi Guys,

 

Just wantd to get a health check to make sure that Im doing this correct.

 

So far I have the tracking code in

www.thermaltech.co.uk/shop/index.php

www.thermaltech.co.uk/shop/product_info.php

www.thermaltech.co.uk/shop/checkout_sucess.php (jsut added code)

 

in my analyics profile.

Goal 1

Goal URL: https://thermaltech.co.uk/shop/checkout_success.php

Goal Name: purchase complete

No Funnels Defined

Match Type : Head

 

Before I added the code to the checkout sucess page, ive had a few sales but nothing matched my "goals" aparantly. Am i right in assuming now that Ive added the code to the checkout_success.php it will now start tracking sales?

Things still to do before going "live" in no real order...

Change "buy now buttons" css styles

Change "lets see what we have here" into something meaningfull

Main logo of the website

Sort out currency to make site UK only (at present)

Remove "xx requests since" stuff

Update mainpage :D

Move shopping cart status into header

Add in stock status to product listing page

Define styles for product listing standardisation

Change CSS background for Headings

Increase Category size headings

Used mods so far:- basic_design_pack1mk7 | Google XML sitemap w admin | Paypal IPN v 1.2 | Feedmachine | pricematch_1_3_1 | Dynamic Sitemap 1.6 | Whos online Enhancement | Easypopulate 2.72

 

Each one that I solve I;ll be putting a post on the forum in a "completed shop" thread that Im writing up

Link to comment
Share on other sites

Before I added the code to the checkout sucess page, ive had a few sales but nothing matched my "goals" aparantly. Am i right in assuming now that Ive added the code to the checkout_success.php it will now start tracking sales?

 

that would be correct

Link to comment
Share on other sites

Hi,

 

I've been using the google analytics module for awhile now and we recently noticed a problem in sales. When ever there is an order that is greater then or equal to $1000 it divides the number by a $1000. So, any order that is $1000 - $1999 gets converted to $1 in google analytics. Order $2000-$2999 gets converted to $2 and so on.

 

Anyone know why this might be happening and how I can fix it.

 

Thanks in advance.

Shade and Sweet Water

Chris Czerniak

Link to comment
Share on other sites

Hi,

 

I've been using the google analytics module for awhile now and we recently noticed a problem in sales. When ever there is an order that is greater then or equal to $1000 it divides the number by a $1000. So, any order that is $1000 - $1999 gets converted to $1 in google analytics. Order $2000-$2999 gets converted to $2 and so on.

 

Anyone know why this might be happening and how I can fix it.

 

Thanks in advance.

 

Chris,

Yes. That occurs because your numbers are formatted with a comma as the thousands separator. The author of this contribution didn't consider that when he wrote it. I re-posted a fix for this issue about a page back here: http://www.oscommerce.com/forums/index.php?s=&...st&p=914901

 

--Glen

Link to comment
Share on other sites

  • 2 weeks later...
Hi,

 

Any chance of listing all the 'content' pages that the code should be placed into.

 

Many Thanks

D4

 

Idally, in every page that is in the root which contains a <head></head> tag

 

or you are a bit lazy and not embed it in all the non-vital pages (like change address, etc...)

 

index.php

product_info.php

shopping_cart.php

checkout_shipping.php

checkout_payment.php

checkout_success.php

Link to comment
Share on other sites

The module is functioning correctly I checked it in the Google analytics pages... its receiving data.. no problem there.. but when the reach checkout_success.php they get some code appearing at the top of the page like this above my header image:

 

// osCoders.biz - Analistics - start // The onLoad="java script:__utmSetTrans()" from the tag // was added for the Google Analytics contribution // osCoders.biz - Analistics - end

 

not sure why this is showing up? could I have installed the code in the wrong place??

 

cheers,

Graham

DJS | MEDIA | MUSIC | CULTURE

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...