DLGuard
fully integrated with the major payment systems
Paypal
Clickbank
2checkout
Authorize.Net
Click2Sell
1ShoppingCart
LinkPoint
AlertPay
eBay
PayDotCom
Mal's e-commerce
PagSeguro
CCBill
CommerceGate
DigiResults
FastSpring
JVZoo
MultiSafePay
WorldPay
Plimus
WSO Pro
Paypal Digital Goods
RevenueWire
SWReg
     

Google Analytics code?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    DLGuard Forum Forum Index -> Member's Tips and Tricks!
View previous topic :: View next topic  
Author Message
anneeasterling



Joined: 29 Jun 2007
Posts: 17

PostPosted: Fri Jun 29, 2007 1:21 pm    Post subject: Google Analytics code? Reply with quote

Hello,

I've searched for the answer to this question... and since it's so basic, maybe I'm missing something obvious... But I'm not seeing the answer so here goes.

Where do I put in my Google Analytics code so I can track conversions?

Thanks,
Anne

PS: By the way, this is an excellent product! Thanks Sam!!
Back to top
View user's profile Send private message
stevenh77



Joined: 09 May 2006
Posts: 26

PostPosted: Sat Jun 30, 2007 6:52 am    Post subject: Google Analytics Reply with quote

Have you tried putting it in the product's "Extra text/HTML code to be
added to download page:" section? If that doesn't work then you might have to create a custom download areat template.
_________________
Check out my blog, Steven's Internet Marketing Tips.


Last edited by stevenh77 on Sun Jul 01, 2007 2:07 am; edited 2 times in total
Back to top
View user's profile Send private message
anneeasterling



Joined: 29 Jun 2007
Posts: 17

PostPosted: Sat Jun 30, 2007 1:20 pm    Post subject: Reply with quote

Aha! I bet that's what I need to do... I'm off to give it a try.

Thanks,
Anne
Back to top
View user's profile Send private message
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Mon Sep 17, 2007 6:11 pm    Post subject: Reply with quote

This really messed up a product I have. There's nothing showing after the custom html box for my clickbank product.

I suspect it's the google javascript code somehow not being allowed to execute on the cb download page.

Now I can't edit the product details as the save button is gone.
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Mon Sep 17, 2007 6:38 pm    Post subject: Reply with quote

I restored from a bakup of my mysql and I'm ok. This field "Extra text/HTML code to be added to download page:" can be dangerous if you put in javascript.
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 31 Jul 2005
Posts: 9396
Location: Australia

PostPosted: Tue Sep 18, 2007 1:08 am    Post subject: Reply with quote

Hmm, Google must have changed their code because you could always use analytics code in the Extra Text box.

For now, just paste it directly into your download page template.

You can find this in your dlg folder:

dlg/templates/singleproduct/default.html

Open this file up in your webpage editor and add the Google code onto this page.

Save it, and upload it to your site. It should work fine like this.



Peter, would you be able to PM me the Google Analytics code you used, if you have it handy? I'll check it out to see why it's messing up the box now.

cheers
Sam
_________________
Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Tue Sep 18, 2007 4:15 am    Post subject: Reply with quote

Yep - it was the "ecommerce" code which is more than just the
usual GA code.

https://www.google.com/support/googleanalytics/bin/answer.py?answer=55528&ctx=sibling

Now that I look at it, I think I left in the [] for the variables.

I'll send it to you in any case.
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 31 Jul 2005
Posts: 9396
Location: Australia

PostPosted: Tue Sep 18, 2007 6:13 am    Post subject: Reply with quote

Thanks for sending that over Peter!

I had a look at the code, and it seems that this function is what is messing things up:

Code:
<script type="text/javascript">
__utmSetTrans();
< /script>


I'm not sure what Google does with this function, but basically it seems to stop the page from loading when this is run.

Now I've done a quick patch to the Edit Product page in DLGuard so that "rogue scripts" won't mess up the Edit page, but you'll still have the problem on the download page.

So you'll need to use Googles suggested method of using the Body onLoad method found here:

https://www.google.com:443/support/googleanalytics/bin/answer.py?answer=55528&ctx=sibling

This should stop the code from messing up your download page.

You can edit your download page template here:

dlg/templates/singleproducts/default.html


If you don't want this code run for all your products, then make a copy of the default.html file and call it something different like "googletemplate.html", make your changes to it, and then upload this file into the dlg/templates/singleproducts/ folder.

Then on your Edit Product page, put "googletemplate.html" in your Custom Download Page Template box, and save your product. Now that template file will be used when someone purchases that product.

cheers
Sam
_________________
Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Tue Sep 18, 2007 3:57 pm    Post subject: download page template Reply with quote

I'm using the cbreturndefault.php (called from sales page domain redirect after split test accelerator php is executed) - is cbreturndefault.php considered a download page template or can I leave that stuff alone and follow your instructions above?
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 31 Jul 2005
Posts: 9396
Location: Australia

PostPosted: Tue Sep 18, 2007 10:30 pm    Post subject: Reply with quote

Hi Peter,

cbreturndefault.php isn't a download template - it's just the script that recieves your Clickbank sale.

By default you'll still be using the template as displayed above, however you can change your custom template from default.html to clickbank.html

The "clickbank.html" template file I added in the v4 update - it's the basically the same as the default.html template except that it displays the Clickbank info that is required (ie. "You'll be billed by Clickbank" notice)

So you can either make a copy of your clickbank.html file, or just edit that one if you want all your Clickbank download pages to have the tracking code on them.

You'll still need to enter "clickbank.html" into your "Custom Download Page Template" though.

cheers
Sam
_________________
Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Wed Sep 19, 2007 4:58 am    Post subject: Reply with quote

Ok I made a clickbankga.html with the google ecommerce analytics in it, including the onload. I did a test purchase and the download page showed ok. Now I just need to wait 3-4 hours until Google reports the conversion in the GA account.

Thanks so far!

-Peter
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 31 Jul 2005
Posts: 9396
Location: Australia

PostPosted: Wed Sep 19, 2007 6:39 am    Post subject: Reply with quote

Great to hear!

Let me know how it goes when Google updates their info!

cheers
Sam
_________________
Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Wed Sep 19, 2007 3:45 pm    Post subject: It worked Reply with quote

It worked - Google Analytics tracked the ecommerce transaction on my dlguard site, for my Clickbank product which has its sales letter and main GA tracking on its own domain.

Here's the code of my template html if anyone else needs this. XXX is for your Google Analytics account. This code is working for me, but you need to put in whatever pricing and product info that you can get from your system. e.g. I still need to change "productname" to my own product name since I now see in the GA reporting the sale for "productname" Smile

See the GA link provided by Sam above for more details on what each variable is and remember not to include the []'s. The customer receipt variable comes through from dlguard and can be found in Google Analytics (Ecommerce-Transactions) to track each unique transaction.

Since this is a Clickbank product I am using the worst case $8 value for revenue - i.e. when an affiliate makes a sale and I pay 75% commission. I don't know how to get the actual revenue (if affiliate involved or not) or more customer info like city and state etc., since I suspect Clickbank doesn't pass this information back to us after a sale.

Cheers,
Peter

Modify body line to include the onload:
Code:
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="javascript:__utmSetTrans()">


Put this code at the bottom just before the end body tag:
Code:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "XXX";
urchinTracker();
</script>

<form style="display:none;" name="utmform">
<textarea id="utmtrans">UTM:T|%%customerreceipt%%|CB|
8|0| 0|city|CA|USA UTM:I|%%customerreceipt%%|AE|productname|category|8|
1 </textarea>
</form>

_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 31 Jul 2005
Posts: 9396
Location: Australia

PostPosted: Wed Sep 19, 2007 10:43 pm    Post subject: Reply with quote

Thanks for the excellent post Peter!

With the product name, you can use this variable: %%productname%%

That'll input the correct product name for each sale if you wish.

I'll move this thread to the Members Tips and Tricks section! You guys rock.

cheers
Sam
_________________
Sam Stephens
DLGuard: www.dlguard.com
GuardHQ: www.guardhq.com
-------
Keep up to date with DLGuard and other GuardHQ products: www.guardhq.com/newsletter.php
www.twitter.com/DLGuard
Back to top
View user's profile Send private message Send e-mail Visit poster's website
asr_guy



Joined: 01 Apr 2006
Posts: 62

PostPosted: Sat Dec 15, 2007 6:54 pm    Post subject: GA has new code Reply with quote

Just an update - Google Analytics has new tracking code.

Here's the link to the page for the NEW code

I haven't tried it yet because the Google geeks can't seem to program - I see a tag like </script< which seems suspicious.

Anyway this should be cleaned up soon so I hope dlguard can handle ecommerce tracking using the new code.

Has anyone else been down this road?
_________________
What's Your Time Worth?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DLGuard Forum Forum Index -> Member's Tips and Tricks! All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group