latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Google Analytics & Ecom Tracking

Home Forums Community Forum Google Analytics & Ecom Tracking

This topic contains 18 replies, has 2 voices. Last updated by  Dina 3 years, 10 months ago.

Topic Author Topic
Posted: Friday Feb 1st, 2013 at 3:40 pm #40302
Dina
Username: codeshed

I am looking to use Google analytics to track general site activity & also track subscriptions through the eComm options in Google Analytics.

Basic tracking is not an issue – just include the tracking script in the footer and your good

What about the eComm transaction tracking? I watched the video on your site and see how I can add in some specifics to the Google analytics script to track the subscription details, but what I am not clear about is what happens to the general tracking. Do I include the general script as normal so it’s included on all pages and also include Ecom scripts in the s2Member® API / Tracking > Signup Tracking Codes – Duplication?

Some direction,documentation or best practices on how to use Google Analytics on a s2Member/Pro site that includes transaction tracking and whatever else is possible would be great!

List Of Topic Replies

Viewing 18 replies - 1 through 18 (of 18 total)
Author Replies
Author Replies
Posted: Saturday Feb 2nd, 2013 at 1:01 pm #40499
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

KB article created from this topic. Please see:
http://www.s2member.com/kb/ga-ecommerce-tracking/

Please let us know if you have any other questions/concerns :-)

Posted: Friday Feb 8th, 2013 at 7:27 pm #41227
Dina
Username: codeshed

Thanks Jason,

I followed the article, but I am not seeing the transaction. I have the general Google code tracking code include in the header of the site and then added the transaction chunk as indicated in the article.

I see the general traffic, but not the e-com data.

Do I need to have the general tracking code in the footer vs the header… an ordering issue?

Posted: Monday Feb 11th, 2013 at 7:57 pm #41476
Staff Member

Thanks for the follow-up :-)

Please post the full code that you’ve implemented for ECOM tracking and I’ll review it with you. Or, submit a Dashboard login privately and we’ll run diagnostics for you. See: s2Member® » Private Contact Form

Posted: Tuesday Feb 12th, 2013 at 11:21 am #41567
Dina
Username: codeshed

Here is the code we have in the API Tracking area

<script type="text/javascript">

  var _gaq = _gaq || [];
  
  _gaq.push(['_addTrans',
    '%%subscr_id%%', // transaction ID - required
    '%%cv0%%', // affiliation or store name
    '%%initial%%' // total - required
  ]);

  _gaq.push(['_addItem',
    '%%subscr_id%%', // transaction ID - required
    '%%item_number%%', // SKU/code - required
    '%%cv0%%', // product name
    '%%item_number%%', // category or variation
    '%%initial%%', // unit price - required
    '1' // quantity - required
  ]);
  
  _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
  
</script>

and then we our standard tracking code included in the header

Posted: Thursday Feb 14th, 2013 at 8:39 pm #41746
Staff Member

Details received. Thank you!

I just reviewed your installation. Your GA Ecommerce Tracking code looks good; as does your main GA tracking code. However, please be sure to paste your GA ECOM tracking code into both fields: Signup Tracking Codes and Modification Tracking Codes. If your Users/Members are purchasing while already logged into the site, that is a Modification and not a Signup. Most sites will want to track both scenarios.

See: Dashboard -› s2Member® -› API / Tracking -› Modification Tracking Codes

ECOM tracking data takes awhile to show up in your GA account. I’ve seen it take up to 48 hours in some cases. So this takes time to see results. Please let me know if you continue to have trouble.

Posted: Monday Feb 18th, 2013 at 11:36 am #42277
Dina
Username: codeshed

Thanks Jason,

We will make that change, but I don’t think that’s the issue. I did a test registration/purchase creating a new account from scratch and the transaction did not show up in Google Analytics…. it’s been more then a week now.

Any other ideas? on which page would the transaction code get fired or is that behind the scenes?

Looking to get the resolved so we can move on with other tweaks!

Dina.

Posted: Monday Feb 18th, 2013 at 8:18 pm #42378
Staff Member

Thanks for the follow-up :-)

Have you integrated with Pro Forms or Buttons? If you can paste the s2Member® Shortcode you used, that will tell me what I need to answer your last question properly.

One trick to testing this, is to place an image that you actually see in your API Tracking fields. That way you’ll know when/where it shows up during your tests.

Posted: Monday Feb 18th, 2013 at 9:06 pm #42386
Dina
Username: codeshed
[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="$97.00 CAD / Yearly Subscription (recurring charge, for ongoing access)" ps="paypal" cc="CAD" ns="2" custom="www.domain_name.com" ta="97.00" tp="365" tt="D" ra="97.00" rp="1" rt="Y" rr="1" rra="0" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="1" default_country_code="" captcha="0" success="/congratulations/" /]
Posted: Monday Feb 18th, 2013 at 11:04 pm #42407
Staff Member

Thanks for your reply :-)

So in this Pro Form, you are redirecting to a Custom Return URL on Success. This means the API Tracking Codes will be displayed at the bottom of your /congratulations/ Page. One thing to verify is that your WordPress® theme calls the wp_footer Hook. This is a WordPress® standard and all themes should make this action Hook display things like tracking codes, etc, in the footer of your theme. That’s what s2Member® uses as well.

See also: http://codex.wordpress.org/Function_Reference/wp_footer

If problems persist after another round of testing, please post a reply and we’ll run a test transaction for you.

Posted: Tuesday Feb 19th, 2013 at 12:13 am #42413
Dina
Username: codeshed

Thanks! Yup.. we’re calling the hook in our theme footer.php.

It is an order thing? We have the generic GA tracking script included in the header and the GA transaction script in the footer.

Do we need to call the generic script AFTER the transaction script?

Posted: Tuesday Feb 19th, 2013 at 1:08 am #42417
Staff Member

It is an order thing? We have the generic GA tracking script included in the header and the GA transaction script in the footer.

No, I don’t think this is a problem.
Just to double check; you DO have Google Ecommerce Tracking enabled for this domain right? In your Google Analytics account. See: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce

I will run a test transaction shortly with a logger attached for you. If you can please confirm this also for me, that would be great. Thank you!

Posted: Tuesday Feb 19th, 2013 at 11:54 pm #42550
Dina
Username: codeshed

Google Ecommerce Tracking is enabled against the profile.

Posted: Thursday Feb 21st, 2013 at 3:38 am #42677
Staff Member

Thanks for the follow-up :-)

Running tests now. Please stand by. Thanks!

Posted: Thursday Feb 21st, 2013 at 3:51 am #42678
Staff Member

Thanks for your patience.

Unable to run a test transaction on your installation. An s2Member Pro Form Shortcode does not provide any way to accept payment on this installation for some reason. Have you made modifications to s2Member?

Does not work properly on this installation:

[s2Member-Pro-PayPal-Form /]

See “Test Page (by Jason Caldwell)” on your installation. Saved as a Draft.

Posted: Friday Feb 22nd, 2013 at 12:37 am #42783
Dina
Username: codeshed

No mods to your core plugin files… Just theming around the registration form. We are using Theme my login.

I went to your test page and published it, complete the registration form and it when out to paypal ($0.01) and returned back to the same registration page with a feedback message at the top. In snooping the source I see the expected google tracking code for the transaction in the footer…soooo it all looks good, including the transaction showing up in Google!

So whats the deal with our version of the shortcode – Is it because we are using a custom return page?
success=”/congratulations/”

Posted: Monday Feb 25th, 2013 at 5:46 pm #43187
Dina
Username: codeshed

Hi Jason,

Any suggested next steps to get this working in our implementation / shortcode ?

[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="$97.00 CAD / Yearly Subscription (recurring charge, for ongoing access)" ps="paypal" cc="CAD" ns="2" custom="www.domain_name.com" ta="97.00" tp="365" tt="D" ra="97.00" rp="1" rt="Y" rr="1" rra="0" accept="paypal" accept_via_paypal="paypal" coupon="" accept_coupons="1" default_country_code="" captcha="0" success="/congratulations/" /]
Posted: Tuesday Feb 26th, 2013 at 3:25 am #43202
Staff Member

Thanks for the follow-up :-)

I went to your test page and published it, complete the registration form and it when out to paypal ($0.01) and returned back to the same registration page with a feedback message at the top. In snooping the source I see the expected google tracking code for the transaction in the footer…soooo it all looks good, including the transaction showing up in Google!

So whats the deal with our version of the shortcode – Is it because we are using a custom return page?
success=”/congratulations/”

OK. So it’s working in the default implementation because you verified the snippet is there. Have you been able to verify the snippet is there on your /congratulations/ page as well? It’s just not showing up in Google Analytics?

If that’s the case, you might check your GA account and be sure there are no exclusions for the /?s2p-v=value that s2Member® passes your Custom Return URL on Success. See also: Dashboard -› s2Member® -› PayPal® Pro Forms -› Custom Return URLs Upon Success -› Verifying Integrity of Replacement Codes w/ s2p-v

Also, you might check to be sure your /congratulations/ page is not configured as a Goal or Funnel page in your GA account; just in case there is some conflict in your GA configuration that’s preventing ECOM tracking from working as expected on that page. Also, testing this with a different success="" value might help.

To answer your question though, no. I don’t see any reason why this would not work on your /congratulations/ page, so long as it uses a WP template that calls upon wp_footer() as it should. Which it is; I verified this on your installation.

If problems persist, I would suggest setting up a quick test installation of WordPress® and making an attempt to reproduce this there. I’ve run a few recent tests against a clean installation — running a default WP theme; and I was unable to reproduce the issue you’ve described. Even with the success="" attribute in use. If nothing else, this type of testing might shed light on the underlying cause for you; allowing you to narrow things down.

Posted: Thursday Feb 28th, 2013 at 7:47 pm #43440
Dina
Username: codeshed

Thanks Jason,

OK. So it’s working in the default implementation because you verified the snippet is there. Have you been able to verify the snippet is there on your /congratulations/ page as well? It’s just not showing up in Google Analytics?

No, I have not seen the GA tracking code on the /congratulations/ ( source view ) . Should I be able to see it ( without the details ) even if I hit that page directly or will the code only be insert on return from payment?

I do have a goal configured against that page and it works, but it seems to me that for some reason the tracking code is not getting inserted as expected.

You suggestion on creating a test environment is valid and if we have to go that route we will, but I was hoping it would not be this difficult to trouble shoot.

Viewing 18 replies - 1 through 18 (of 18 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.