BV Commerce Forum
»
BV Commerce Support
»
Development
»
How to Add Google Analytics and eCommerce Tracking to BV Commerce 5
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
1) Add Google tracking code to all .master pages in your theme. replace: with: Code:<!--Google--> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-MYGOOGLEID"; urchinTracker(); </script> <!--EndGoogle--> </head>
NOTE: Replace the words "MYGOOGLEID" with your own Google Analytics ID! 2) Save the GoogleAnalyticsReceipt.ascx and GoogleAnalyticsReceipt.ascx.vb files to /BVModules/Controls 3) Edit the receipt.aspx page and add this line at the top: Code: <%@ Register Src="BVModules/Controls/GoogleAnalyticsReceipt.ascx" TagName="GoogleAnalyticsReceipt" TagPrefix="uc2" %>
4) Edit Receipt.aspx again replace: with: Code:<uc2:GoogleAnalyticsReceipt ID="GoogleAnalyticsReceipt1" runat="server" /> </asp:Content> NOTE: It will take at least 24 hours for the tracking information to show up in Google Analytics. For more information see this help file from Google: https://www.google.com/support/a...nswer=26926&hl=en_USEdited by user Friday, June 3, 2016 12:52:22 PM(UTC)
| Reason: Not specified File Attachment(s): GoogleAnalyticsReceipt.ascx (1kb) downloaded 587 time(s).You cannot view/download attachments. Try to login or register.
|
|
|
|
Rank: Member
Joined: 5/24/2004(UTC) Posts: 4,147
|
Will this automatically account for secure pages? If not, I'd recommend using the Analytics script that starts with https, otherwise your customers will get security errors during checkout. |
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
You're correct Cliff,
In checkout.master and myaccount.master you will want to use "https://ssl.google-analytics.com/urchin.js"
|
|
|
|
Rank: Member
Joined: 2/3/2004(UTC) Posts: 111
|
Guys,
Thanks for the help. Also, just to confirm checkout.master. I don't see this in any of the master files. Are you guys suggesting taking the default.master, copying it and renaming it to checkout.master. Then I'm assuming we make sure the checkout pages reference the new checkout.master as opposed to the default master.
Is this correct? |
|
|
|
|
Rank: Member
Joined: 5/24/2004(UTC) Posts: 4,147
|
Almost correct. When you create a new masterpage called checkout.master, the application should automatically use that masterpage for the checkout. |
|
|
|
|
Rank: Member
Joined: 3/25/2006(UTC) Posts: 111
|
Hello,
Any way to have the ability to edit a text box in the admin that would automatically be inserted in the checkout page? I have this with another cart and it makes it extrememly easy to add tracking codes and other content to the checkout page without having to edit the checkout page template itself.
Thanks,
Bob
|
|
|
|
Rank: Member
Joined: 5/14/2005(UTC) Posts: 398
|
if you don't already have multiple mater pages and you want to continue just using one then wouldn't it be easier to just do an if then on .IsSecureConnection to use the correct script path? |
|
|
|
|
Rank: Member
Joined: 4/4/2004(UTC) Posts: 670
|
Carl, Yes. stop answering your own questions..... ;)
Scott Mech
|
|
|
|
Rank: Member
Joined: 8/2/2005(UTC) Posts: 41
|
Marcus,
I noticed you have commented out 'affiliation' and 'category' in your control.
You should really leave these in, or as i found, all your a parameters will be in the wrong position and register incorrectly with Google.
Rick
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
|
|
|
|
Rank: Member
Joined: 2/3/2004(UTC) Posts: 111
|
Thanks for all of the feedback on my original post |
|
|
|
|
Rank: Member
Joined: 12/15/2006(UTC) Posts: 31
|
am I just imagining things but is there no "</asp:content>" in the GoogleAnalyticsReceipt.ascx?
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Notice that the download ends in "asCx" which indicated a web user control, not a page. You will need to add this control to an existing page which may have an <asp:content> tag if the page uses masterpages.
|
|
|
|
Rank: Member
Joined: 12/15/2006(UTC) Posts: 31
|
sorry maybe Im missing a trick here - basically I add the controls to the site, add the Javascript to the master files and then add the content column to each aspx file?
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
Russel,
You don't do anything with content columns. Take a look at the first post in this thread again. You edit the master page first, then install the control, then edit RECEIPT.aspx to add the control to that page.
|
|
|
|
Rank: Member
Joined: 1/23/2006(UTC) Posts: 103
|
For some reason the viewstate control is getting put right before the </form> tag that the google analytics code creates instead of the very last </form> tag on the page. Is there a way to have this not happen? Thanks!
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
We're working on an update for this. The workaround is to turn off the "move view state to bottom of the page" option under "Options->Performance" in the bv admin.
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 2,136
Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: "Christian Moments" For some reason the viewstate control is getting put right before the </form> tag that the google analytics code creates instead of the very last </form> tag on the page. Is there a way to have this not happen? Thanks!
This is probably a good thing. If there are 2 (or more) </form> tags on the page, everything after the first one will be invisible to ASP.NET (the ASP.NET postback page parser stops looking when it reaches the first </form> tag). So if you move the viewstate to be after the first </form> tag, it will be invisible and the page will not function correctly. |
|
|
|
|
Rank: Member
Joined: 1/23/2006(UTC) Posts: 103
|
I got the google analytics e-commerce tracking to work! There is one error in the script
You need to call this fuction: __utmSetTrans()
There are two underscore _ characters before utmSetTrans(), not one.
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
I'll check the code again but that could be a big bug! Thanks for catching it.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.