When the uc_googleanalytics.module is enabled, it should add the appropriate Google Analytics code to the footer of the page upon a successful checkout.
If the "Alternate checkout completion page:" option is used in the Checkout settings, this doesn't seem to work for url aliased completion pages.
Lines 69 - 74 of uc_googleanalytics.module (6.x-2.0) read as follows:
// Or if the URL is the custom completion page.
$completion_page = variable_get('uc_cart_checkout_complete_page', '');
if (!empty($completion_page) && $completion_page == $_GET['q']) {
return TRUE;
}
For a completion page stored as its url alias, this should compare the alias of $_GET['q'] with the 'uc_cart_checkout_complete_page variable, as follows
// Or if the URL is the custom completion page.
$completion_page = variable_get('uc_cart_checkout_complete_page', '');
if (!empty($completion_page) && $completion_page == drupal_get_path_alias($_GET['q'])) {
return TRUE;
}
This is a small change, but it took me a while to figure out.
I just checked out the latest HEAD version, and while the code has changed somewhat, it still seems to compare the uc_cart_checkout_complete_page variable directly with $_GET['q'].
It's only a one liner, but I attach a patch against HEAD in case it is of use.
Hope this helps.
Comment | File | Size | Author |
---|---|---|---|
#2 | uc_googleanalytics-completion.patch | 508 bytes | dbassendine |
uc_googleanalytics_20091106_HEAD.patch | 1.01 KB | Finn Lewis | |
Comments
Comment #1
dbassendine CreditAttribution: dbassendine commentedWe've encountered this issue too, which still exists in 2.4. This patch provides an effective fix. Here's my +1 for including it in the next release.
Thanks, David
Comment #2
dbassendine CreditAttribution: dbassendine commentedMy apologies. This is still an issue in 2.4. However, the patch provided above does not apply successfully to the 2.4 version of uc_googleanalytics.module. I've attached an updated version below.
Thanks, David
Comment #3
TR CreditAttribution: TR commentedComment #5
longwaveCommitted to both branches.