Announcement

Collapse
No announcement yet.

Split wholesale traffic into seperate google analytics?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Split wholesale traffic into seperate google analytics?

    Hi all,
    I have a lot of wholesale traffic now that is really skewing my stats when I look at it all combined.
    I was hoping to break it out into two chunks, basically, those who are logged into the Wholesale Price group, and those who are not. I thought I could do it like this:

    <mvt:if expr="g.WHOLESALEPRICINGgroup EQ 'WHOLESALEPRICING'">
    google analytics B
    <mvt:else>
    google analytics A
    </mvt:if>

    but I'm getting no data at all for analytics B with this in the global footer and all the checkout pages.
    Does anyone have any experience with this? Any suggestions of how I might accomplish it?

    Thanks in advance-
    Chad
    chad oesterreich ·director of corporate optimization

    www.soul-flower.com · 651.251.1028 · [email protected]

    #2
    Re: Split wholesale traffic into seperate google analytics?

    Where are you deriving the variable name and value from? If you're getting "A" data, then the premiss (variable/variable value) that triggers "B" is never happening.

    Start with the variable you are testing.

    Comment


      #3
      Re: Split wholesale traffic into seperate google analytics?

      I have never done this, but I think the best way to do this is to use a single Google Analytics account and then use the custom variables to define the traffic. You can then set up "Profiles" under your account and apply filters to look for the custom variables, so you could have a "Whole Site" account, a "Wholesale" profile, and a "Non-Wholesale" profile.

      https://developers.google.com/analyt...ustomVariables

      I know for awhile you couldn't filter on custom variables and you had to use "user defined" fields, but I think that has since been fixed. If you have issues, you can use the old (deprecated) setVar: https://developers.google.com/analyt...acker_._setVar

      Comment


        #4
        Re: Split wholesale traffic into seperate google analytics?

        Thanks Brandon, that seems like the right approach as a common example they use is tracking members vs non-members on sites, based on their instructions I can add:

        _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]);

        to my google analytics code, but what I don't understand and can't seem to find anywhere is how google knows what 'Wholesale' means? How do I identify logged in wholesale (price group) customers so that they are identified by this custom variable?
        chad oesterreich ·director of corporate optimization

        www.soul-flower.com · 651.251.1028 · [email protected]

        Comment


          #5
          Re: Split wholesale traffic into seperate google analytics?

          Analytics has a heirachy so you can create different profiles under the same website (property). The way Analytics is structured is Account (ABC Widget Inc) > Property (www.abcwidget.com) > Profile (ABC Widget.com Traffic). In a standard setup you'll have a single profile under your property which makes it look redundant, but it actually gives you some flexibility.

          For this, what you will end up doing is creating two profiles in Analytics. One you'd call "Wholesale Customers" and the other "Retail Customers". To do this, go from your Account list and click on the admin link in the top right corner. From there click on your Account, then your property. From here, you'll click New Profile. Once you've named it, you can then go in and create a filter so that some data is excluded.

          This is where it gets tricky and I can't walk you through it completely. Give your filter a name (Wholesale Traffic) and then using a custom filter, "Include" filter field "Custom Field 1" or "User Defined" (depending if you use setCustomVar or setVar). The matching pattern should be Yes in your case.

          When you create your second filter (Retail Traffic), you'll use "Exclude", but the rest of the settings will be identical.

          This may take some trial and error to get it all correct, but the nice thing is you'll have a third profile that has all of your traffic, so you aren't losing anything. Once you get everything up and running and you're confident with it, you can even rename that third profile so that you can look at aggregate data or specific traffic as needed.


          ---


          There is also a way to do this using segments in Analytics (which is much simpler), but that will end up slowing down your reports and causing you to trigger their report sampling: http://support.google.com/analytics/...answer=1042498

          Comment


            #6
            Re: Split wholesale traffic into seperate google analytics?

            Thank you for going to so much trouble to explain this so thoroughly, I am working on making it happen!
            chad oesterreich ·director of corporate optimization

            www.soul-flower.com · 651.251.1028 · [email protected]

            Comment


              #7
              Re: Split wholesale traffic into seperate google analytics?

              I am still struggling with this setup, I have everything done on the google analytics end, but what I don't understand is how to communicate to Google that my custom variable is true or false.

              The analytics script contains this:
              _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]);

              and then I have the segments set up in analytics, but how does analytics know if the variable is true or false?

              I tried putting this in the global head tag, but it is really just a guess. I am a beginner at Java script

              Can anyone help? or am I just too far over my head on this one?

              <mvt:if expr="g.WHOLESALEPRICINGgroup EQ 'WHOLESALEPRICING'">
              <script type="text/javascript">
              var Wholesale = 'Yes';
              </script>
              <mvt:else>
              <script type="text/javascript">
              var Wholesale = 'No';
              </script>
              </mvt:if>
              chad oesterreich ·director of corporate optimization

              www.soul-flower.com · 651.251.1028 · [email protected]

              Comment


                #8
                Re: Split wholesale traffic into seperate google analytics?

                Did you create a filter on each profile? "Custom Field 1" matches "Yes" = Wholesale Traffic

                Comment


                  #9
                  Re: Split wholesale traffic into seperate google analytics?

                  Yes, I created a Wholesale Traffic profile, and created a filter named Wholesale set to Include Custom Field 1 with a filter pattern of Yes. Then I did the same thing for a retail filter, but set to exclude.
                  chad oesterreich ·director of corporate optimization

                  www.soul-flower.com · 651.251.1028 · [email protected]

                  Comment


                    #10
                    Re: Split wholesale traffic into seperate google analytics?

                    So is the question about creating the JavaScript or getting the filters to work?

                    Comment


                      #11
                      Re: Split wholesale traffic into seperate google analytics?

                      I guess my question is what am I doing wrong? I followed all the instructions for creating the custom variable, and the filter, by I don't see how the variable means anything to Google.

                      Basically how would I get from:

                      I am a wholesale shopper logged in->
                      ??????? ->
                      I am identified as a wholesale customer by:
                      _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]); ->
                      my data can now be segregated by the wholesale filter

                      to put it another way, in this script:
                      _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]);

                      I just typed in "Wholesale" for the variable name, and "Yes" for the value. I could have typed in "Potato" and "Yes" but how would google analytics know if a customer is a potato?
                      Sorry, that may make no sense at all but I may be even more confused than I know.
                      Thanks for helping, Chad
                      chad oesterreich ·director of corporate optimization

                      www.soul-flower.com · 651.251.1028 · [email protected]

                      Comment


                        #12
                        Re: Split wholesale traffic into seperate google analytics?

                        That 1 after "_setCustomerVar" tells Google that this is "Custom Field #1". If you typed 2, it would be Custom Field #2.

                        https://developers.google.com/analyt...ustomVariables

                        "Wholesale" is shown in the reports, but when creating filters, Google doesn't key off of it.

                        Comment


                          #13
                          Re: Split wholesale traffic into seperate google analytics?

                          Chad, are you wanting to know how to identify that a wholesale customer is logged in? If so, you'll need the toolkit to check against your price groups and then use a miva conditional to control which of your google scripts will send data.

                          Comment


                            #14
                            Re: Split wholesale traffic into seperate google analytics?

                            Yes, I think that's my issue. I was trying to do that with this in the header:

                            <mvt:if expr="g.WHOLESALEPRICINGgroup EQ 'WHOLESALEPRICING'">
                            <script type="text/javascript">
                            var Wholesale = 'Yes';
                            </script>
                            <mvt:else>
                            <script type="text/javascript">
                            var Wholesale = 'No';
                            </script>
                            </mvt:if>

                            I don't know that this if/else uses the toolkit, but I use it do display conditional wholesale content, in probably 20 different places on my site, so I thought it would work in this case?

                            but are you saying I should run this with two different google scripts more like this? (but with the whole GA script, not just the CustomVar piece)

                            <mvt:if expr="g.WHOLESALEPRICINGgroup EQ 'WHOLESALEPRICING'">
                            _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]);
                            <mvt:else>
                            _gaq.push(['_setCustomVar', 1, 'Wholesale', 'No', 1]);
                            </mvt:if>
                            chad oesterreich ·director of corporate optimization

                            www.soul-flower.com · 651.251.1028 · [email protected]

                            Comment


                              #15
                              Re: Split wholesale traffic into seperate google analytics?

                              I have some code where I do a similar check. I updated it for your wholesale group:
                              Code:
                              		<mvt:item name="toolkit" param="pgroup|pcount" />
                              		<mvt:if expr="g.pcount GT 0">
                              			<mvt:foreach array="customer_pgroups" iterator="customer_pgroup">
                              				<mvt:if expr="l.settings:customer_pgroup:name EQ 'Wholesale'">
                              					<mvt:item name="toolkit" param="sassign|wholesalepricing|1" /> 
                              				</mvt:if>
                              			</mvt:foreach>
                              		</mvt:if>
                              As long as that code is above your JavaScript, you can then use this to set your variable:
                              Code:
                              <mvt:if expr="NOT ISNULL g.wholesalepricing">
                              _gaq.push(['_setCustomVar', 1, 'Wholesale', 'Yes', 1]);
                              <mvt:else>
                              _gaq.push(['_setCustomVar', 1, 'Wholesale', 'No', 1]);
                              </mvt:if>

                              Comment

                              Working...
                              X