Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Dec 2007
    Location
    London
    Posts
    184
    Plugin Contributions
    0

    Default Google Analytics "google_conversion_value" - what value do I use?

    We've added some Analytics code to our checkout_success template page to track conversions from our AdWords advertising.
    Our marketing agency is trying to find out what the variable is that generates an order's total value in Zen Cart.
    They want to insert this variable into the Analytics tracking code so we are able to see the cart value of each conversion.

    They did some research and found that the variable is "order_total" but it doesn't seem to be working. Does anyone know what else this variable could be?
    It's inserted into the Analytics code as shown below:

    -----------------------------------------------------------------------------------------------------------------------------------------------
    <!-- Google Code for Value of order Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = xxxxxx;
    var google_conversion_language = "en";
    var google_conversion_format = "1";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "xxxxxx";
    var google_conversion_value = order_total;
    /* ]]> */
    </script>
    <script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/1032646217/?value=order_total&amp;label=xxxxxx&amp;guid=ON&amp;script=0"/>
    </div>
    </noscript>
    -----------------------------------------------------------------------------------------------------------------------------------------------

  2. #2
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Do I understand correctly that to use variable Order Final Total I need to copy line <?php echo $order_summary['order_total']; ?> and paste to Google analitics CONVERSOIN VALUE?

    Correct syntactic is including < and >. Isn it?


    Conversion category
    Page security level: HTTP
    Markup Language: HTML
    Conversion value:
    <?php echo $order_summary['order_total']; ?>
    Tracking indicator
    Google Site Stats privacy notification (English)



  4. #4
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Is it appropriet, also, to add this code, generated by Google analitycs by using Defined Page editor from Tools menu and use suboption
    "<> - Toggle HTML code"?

    Will it be saved correctly?

    Or it should be done only via Notepad++ ?

    ######################################################################_

    <!-- Google Code for Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 2063694535;
    var google_conversion_language = "en";
    var google_conversion_format = "1";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "CF9ZCOiZ8wMTwOGa-wM";
    var google_conversion_value = <?php echo $order_summary['order_total']; ?>;
    /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/2063694535/?value=%3C?php%20echo%20$order_summary%5B'order_total'%5D;%20?%3E&amp;label=CF7Z COiZ5wMQwOGa-wM&amp;guid=ON&amp;script=0"/>
    </div>
    </noscript>

  5. #5
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Please ignore my previous postins.

    All assumptions are incorrect.

    I am still searching.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Quote Originally Posted by idtags View Post
    Is it appropriet, also, to add this code, generated by Google analitycs by using Defined Page editor from Tools menu and use suboption
    "<> - Toggle HTML code"?

    Will it be saved correctly?

    Or it should be done only via Notepad++ ?
    Um ... if "conversion value" is supposed to refer to "the amount of the purchase just completed", then putting your google code into a Define Page is definitely NOT going to be useful. At least, not the way Zen Cart works anyway.

    Those $order_summary data pieces are available on the checkout_success page.
    Why are you trying to put them onto a Define Page?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    DrByte,
    Thank you for reply.

    Yes, after experimenting with the system it is clear that Define Page editor deals only with textual information.

    Google is asking for numerical (currency) variable which represents total value in dollar amount customer paid for product.
    I assume that Google code has to be inserted in the file where this variable literary exist to pick it up(?)

    Question is what exactly to enter from available suggestions of the forum.

    Us, none programmers always have fun to identify right one.

    I found following options:

    • $order_summary['order_total']
    • order_total
    • <?php echo $order_total ?>
    • $order_summary


    I am not sure what is syntactic, so I will start experiments with <?php echo $order_total ?>

    There are also different suggestions for files where to insert Google code:
    • /includes/templates/YOUR_CUSTOM_TEMPLATE_NAME/checkout_success/tpl_footer.php
    • \includes\templates\MY_Custom_Template\common\tpl_main_page.php


    I will start with \includes\templates\MY_Custom_Template\common\tpl_main_page.php


    If anybody knows what to do for sure and can describe it for none programmers it will be a help.

    Otherwise, I will publish suggestions when I will make it working.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Let's back up to the very beginning: What EXACTLY are you attempting to accomplish here?

    There are several discussion threads which already explain how to manually set up Google Analytics code in your store, but if you're looking to do it the easy way, there's a plugin that already takes care of all the details. But it assumes you're wanting analytics based on sales made by buying products in Zen Cart using the normal Zen Cart checkout process.
    Your posts make it sound like you're trying to do something outside of normal checkout flow.
    And we can't help you if you don't explain what your desired outcome is and what business problem you're trying to solve here.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    I am trying to do exactly the same as Dunk described in begining of this Thread.

    They were trying to use variable order_total and it did not work.

    In big picture.
    I did signed for Google AdWords and Google analytics at google web site.
    To gage effectivness of advertising Google introduced conversion rate parameter.
    In order to collect data, they (ask to) inject their code in one of Zen Cart pages which involves in check-out process.
    This will be compared with an amount of visitors and statistics will be calculated.

    One of steps of this process is generating of Snipped code to inject in to Zen Cart page.
    They offer template and ask for number of options and one of them is "What variable is used in Zen Cart which can tell to Google total dollar amoung of purchase". You plug name of this variable in provided template and Google generates code which you copy and paste in the page which has can pass value of total amount to Google system for processing.

    This is as far as I can describe this process. My programming ability is below avarage, but I can follow instructions.

    So, plan is to use variable: <?php echo $order_total ?>

    This generates via Google analitics following code:

    ***************************************************************
    <!-- Google Code for Medical Id Bracelets Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 222333369;
    var google_conversion_language = "en";
    var google_conversion_format = "1";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "CF7wweSDSDGMQwOGa-wM";
    var google_conversion_value = <?php echo $order_total ?>;
    /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/222333369/?value=%3C?php%20echo%20$order_total%20?%3E&amp;label=CF7wweSDSDGMQwOGa-wM&amp;guid=ON&amp;script=0"/>
    </div>
    </noscript>

    I inserted this code in page \includes\templates\MY_Custom_Template\common\tpl_main_page.php before </body> as Google recommend.

    Testing is ahead.

    I believe this is a simple process to test market.

    I read about a special module "Google analytics" written for Zen Cart.

    I think to try it in future.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,391
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Google Analytics "google_conversion_value" - what value do I use?

    Google generates javascript for you. It doesn't generate PHP.

    So their "?value=%3C?php%20echo%20$order_total%20?%3E&amp;label=..." won't work.

    Better approach, since Google's generator isn't smart enough:

    1. Tell google's generator to use $VAR
    2. Then when you get their generated code, replace $VAR with the correct replacement code: <?php echo $order_summary['order_total']; ?>


    3. And \common\tpl_main_page.php is the wrong page, because that will put the code on EVERY page, even the pages that don't handle checkout.
    So, follow the instructions provided at the links I gave earlier, and put it into /includes/templates/YOUR_CUSTOM_TEMPLATE_NAME/checkout_success/tpl_footer.php
    Ref: http://www.zen-cart.com/content.php?...els-to-my-site
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 "PHP Warning: Creating default object from empty value" what is this?
    By gsmsalers in forum General Questions
    Replies: 3
    Last Post: 9 May 2014, 06:54 PM
  2. "__gat is undefined" error from Google Analytics code
    By jabbawest in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 13 Sep 2010, 02:07 PM
  3. Display "Best Sellers" like "What's New" or "Specials" lists.
    By jsmooth in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Jun 2010, 12:06 AM
  4. no "body" tag in view source after installing the Simple Google Analytics module
    By notageek in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 19 May 2010, 04:31 AM
  5. "Google Analytics by Andrew" Proper Configuration??
    By C_R_C in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Nov 2009, 08:19 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR