| View previous topic :: View next topic |
| Author |
Message |
anneeasterling
Joined: 29 Jun 2007 Posts: 17
|
Posted: Fri Jun 29, 2007 1:21 pm Post subject: Google Analytics code? |
|
|
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 |
|
 |
stevenh77
Joined: 09 May 2006 Posts: 26
|
Posted: Sat Jun 30, 2007 6:52 am Post subject: Google Analytics |
|
|
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 |
|
 |
anneeasterling
Joined: 29 Jun 2007 Posts: 17
|
Posted: Sat Jun 30, 2007 1:20 pm Post subject: |
|
|
Aha! I bet that's what I need to do... I'm off to give it a try.
Thanks,
Anne |
|
| Back to top |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Mon Sep 17, 2007 6:11 pm Post subject: |
|
|
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 |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Mon Sep 17, 2007 6:38 pm Post subject: |
|
|
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 |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9134 Location: Australia
|
Posted: Tue Sep 18, 2007 1:08 am Post subject: |
|
|
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 |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
|
| Back to top |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9134 Location: Australia
|
Posted: Tue Sep 18, 2007 6:13 am Post subject: |
|
|
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 |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Tue Sep 18, 2007 3:57 pm Post subject: download page template |
|
|
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 |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9134 Location: Australia
|
Posted: Tue Sep 18, 2007 10:30 pm Post subject: |
|
|
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 |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Wed Sep 19, 2007 4:58 am Post subject: |
|
|
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 |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9134 Location: Australia
|
|
| Back to top |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Wed Sep 19, 2007 3:45 pm Post subject: It worked |
|
|
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"
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 |
|
 |
admin Site Admin
Joined: 31 Jul 2005 Posts: 9134 Location: Australia
|
Posted: Wed Sep 19, 2007 10:43 pm Post subject: |
|
|
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 |
|
 |
asr_guy
Joined: 01 Apr 2006 Posts: 62
|
Posted: Sat Dec 15, 2007 6:54 pm Post subject: GA has new code |
|
|
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 |
|
 |
|