Adding google conversion tracking on a conditional basis to a template

Hi there
I have a series of snippets of google conversion tracking code that I need to add just before the body tag to a handful of pages.
It's not sufficient to just add it to the template that all these pages are based on as it varies from page to page.
Also if I add it to the actual pages (rather than the template) then I can't insert it just prior to the </body> tag as stipulated.
So I need to conditionally add it to the template, testing for page name. But I can't find any documentation on how to achieve this.
Any clues would be appreciated.

You could potentially do this with some JS trickery, but you can also use BC's alpha "liquid" mark up to do this in your template.
In your template, use this code just before your </body> tag: https://gist.github.com/3095613
This is using the "page" global., which you can find documentation for at: http://kb.worldsecuresystems.com/919/cpsid_91970.html?bc-partner#main_Page - check out the examples for more uses of Liquid. The above syntax is pretty simple though and should suit your needs.
Just replace "firstpagename" and "secondpagename" with the actual page names you want to check against, then you can add additional {% elseif page.name == 'whateveryouwant' %} clauses before the final {% endif %}. There's no limit on the number of if statements you loop through. This will let you conditionally render different JavaScript blocks based on page name.
Also refer to: https://github.com/shopify/liquid/wiki/Liquid-for-Designers for info on the Liquid syntax.
Jackson.

Similar Messages

  • Google Adwords Conversion Tracking

    Has anyone successfully implemented Google Adwords Conversion Tracking for a phone number push on a mobile landing page? 

    Hi Gaurav,
    I have been trying that.  The problem is that I need to include a Google "onclick" command in a spot that I can't edit.  I added Google Analytics and other Google Adwords Conversion Tracking snippets utilizing the Object Menu -> insert HTML and those are working fine.  It is the onclick command on the phone number that I cannot get to work.  The Google Adwords team told me that I need to add the "onclick" command into the script that Muse created for the actual hyperlink/button.  (the bold is what they are telling me needs to be added)
    <a class="nonblock nontext rounded-corners Phone-Number-Blue clearfix grpelem" id="u226-6" href="tel:509-676-xxxx" onclick="goog_report_conversion('tel:509-676-xxxx')"><!-- content --><p id="u226-4"><span title="(509) 676&#45;xxxx">(509) 6</span><span title="(509) 676&#45;xxxx" title="(509) 676&#45;xxxx" id="u226-2">7</span><span title="(509) 676&#45;xxxx">6&#45;xxxx</span></p></a>
    All of my Google page conversion tracking is working just fine.  But I have not been able to make the conversion tracking for the telephone number on a mobile landing page.  Any assistance you can offer would be greatly appreciated!
    Thank you.

  • How do i stop google from tracking me and storing their cookies? Running OSX 10.7.5 & Safari v6.02 on Macbook Air.?

    how do i stop google from tracking me and storing their cookies?
    Running OSX 10.7.5 & Safari v6.02 on Macbook Air.?

    In practicality you can't. You can set the preference in the Privacy pane of the Safari preferences to ask websites not to track you, but I don't believe Google honors that setting, and they most certainly store all sorts of cookies which you probably will get even if you set Safari to block all cookies since web programmers have ways around those blocks. All you can do is delete the cookies and other junk on a regular basis. Many cookies hide, so I use Cookie from SweetP productions which does a good job of deleting most if not all of the cruft web sites leave.
    Regards.
    Disclaimer: any product suggestion and link given is strictly for reference and represents my opinion only. No warranties express or implied. I get no personal benefit from the sale of any product I may recommend in any of my posts in the Discussions. Your mileage may vary. Void where prohibited. You must be this tall to ride. Objects in mirror may be closer than they appear. Preservatives added to improve freshness. Contestants have been briefed on some questions before the show. No animals were harmed in the making of this post.

  • Creation of a new Formula Routine for condition base value calculation

    hello people,
    i am stuck up in a situation where SAP has itself said that nothing can be done.
    but i know you all can guide me to some way or the other
    see, the scenario is like this
    1. i have to calculate the base value for a pricing condition.
    which will follow the formula
    net value + excise duty + freight
    2. in standard routines two things are normally bieng used
    xkwert for the value that has to be finally calculated(taking reference of routine 004)
    komp-netwr for the net value
    3. i have to calculate the excise duty by adding up all the base values of existing pricing conditions like JMOP, JEC1 etc that i have which i saw in internal table
    XKOMV on debugging
    4. now freight is to be calculated from all the values of condition types that are in KOMP which is a structure and no internal table is defined in standard main program
    now ppl
    can you guide me by looking at the standard program
    what is this xkwert field and where it is assigning the value.
    how to get field from other structure and table.
    please guide as to how to approach the problem.
    thanks and regards
    Nitin

    HI,
    the scenario u r talking abt is condition based value formuls of VOFM transaction.
    here the data is retrieved as 'X' structures and will hold normal tables with respective names. and in this case all the pricing data is in KOMV ie XKOMV
    Final amount including tax
    form frm_kond_basis_004.
      xkwert = komp-netwr + komp-mwsbp.
    endform.
    always calulation is done in xkwert field and final value is stoerd in xkomv.
    *.................. text ............................................. *
    Condition base value formula to get the assessable value of the     *
    saleable material from j_1iassval. If the value is not maintained   *
    then the selling price will be taken as the base                    *
    TABLES: J_1IASSVAL.
    DATA XXKOMV LIKE KOMV .
    XXKOMV = XKOMV.
    SELECT SINGLE * FROM J_1IASSVAL WHERE J_1IWERKS = KOMP-WERKS AND
                                         J_1IMATNR = KOMP-MATNR.
    IF SY-SUBRC EQ 0.
        IF J_1IASSVAL-J_1IVALNDP NE 0.
        XKWERT = J_1IASSVAL-J_1IVALNDP * KOMP-MGLME / 1000.
        ENDIF.
        IF J_1IASSVAL-J_1IVALASS NE 0.
        XKWERT = J_1IASSVAL-J_1IVALASS * KOMP-MGLME / 1000.
        ENDIF.
    ELSE.
       XKWERT = XXKOMV-KAWRT .
    ENDIF .
    XKOMV = XXKOMV .
    ENDFORM.
    and as far as ur  req select allthe condition type data and sum and take the average value and pass it.

  • Why does DW CC 2014.1 Fluid Grid load HTML file that contains Google Analytics Tracking Code script so slowly?

    I exclusively work in Fluid Grid since my site is a Responsive Web Design.  I'm having trouble with slow load time in DW CC 2014.1, when my file, as they all do of course, has the Google Analytics Tracking Code script.
    I'm on a Windows 8.1 using a Dell Precision M3800 Laptop with Memory 16GB (2x8GB) 1600MHz DDR3 . Each of our site's 180 or so web pages, of course, has its Google Analytics Tracking Code script. It is placed, following Google instructions, as the last entry in the <head>.  Google Analytics does not instruct to place the script in the JS Folder with an scr to it, but rather in the <head>.  It takes up to one and a half or two minutes for DW CC 2014.1 to load the Google Analytics Tracking Code script .  That is, the grid does not show in Live View until finally analytics.js shows up in the Document Toolbar. A minute or two can add up when every page you load takes this long.  And, making new Fluid Grid pages, as is done, through the Save As command; every new page made you have to deal with the minute or two wait time since all those pages have the Google Analytics Tracking Code script.  Therefore, this time component alone, assuming I'm accessing and/or making 20 pages per week (and in our business this is easily the case) the math is that I'm wasting between 17 and 35 hours per year just with DW CC 2014.1 loading the much needed Google Analytics Tracking Code script.
    I have loaded HTML files that do not have the Google Analytics Tracking Code script as a test and those files load at the normal quick speed.
    Therefore, the new Chromium Embedded Framework browser engine has a serious load problem when it confronts an HTML5 file with a Google Analytics Tracking Code script.  Oddly, the prior DW CC 2014 version, with the old browser engine did not have this slow-load problem since I was loading these same files in that DW CC version up until October 8th or so.
    I think this new browser engine is a Google platform that apparently has a problem rendering or loading a Google Analytics Tracking Code script.  That makes no sense.
    Anyone else had this particular slow-load problem with DW CC 2014.1?
    Thanks.

    Wow.  That sure solved the slow-load problem, at least using your suggested snippet in a simple test HTML file.
    Per Google's instructions, I pasted the snippet before the closing </head> tag.  And, even in that positioning in the file; the file loaded at the speed (about one second) that it did prior to DW 2014.1.
    Two questions.
    Will this snippet provide the same tracking data as my current GA snippet?
    Because my current GA snippet is in about 200 web pages, can I retain the old snippet in most of them and place the new snippet in my approximately 5 main web pages as well as my templates so my new pages, as well as my main pages, have the new snippet.  That is, can I have both snippets (i.e. old snippet in earlier pages and new snippet in main pages and new pages to be made going forward) in my website at the same time?
    Of course I would not have both the old and new snippet in a web page at the same time.
    I greatly appreciate any assistance anyone can provide me on this issue and thank all of you in advance.
    I've provided code for both simple test files below.
    Code for Asynchronous Syntax of GA script:
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test Asynchronous GA Tracking Code In Head</title>
    <link href="css/boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/css/style.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="js/respond.min.js"></script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-73425000-1']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="div1" class="fluid">
        <div id="test1" class="fluid ">This is the content for Layout Div Tag "test1"</div>
       <div id="test2" class="fluid ">This is the content for Layout Div Tag "test2"</div> 
    </div>
    </body>
    </html>
    Code for older GA script snippet:
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test GA Tracking Code In Head</title>
    <link href="css/boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/css/style.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="js/respond.min.js"></script>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-73425000-1', 'auto');
      ga('send', 'pageview');
    </script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="div1" class="fluid">
        <div id="test1" class="fluid ">This is the content for Layout Div Tag "test1"</div>
       <div id="test2" class="fluid ">This is the content for Layout Div Tag "test2"</div> 
    </div>
    </body>
    </html>

  • Set up conversions tracking with Iad Workbench

    Hello,
    I am starting to set up Iad Workbench and trying to sort out the conversion tracking.
    I would like to integrate the tracking into Mixpanel, eventually MAT (mobile app tracking), Adjust and Google Analytics if not possible with Mixpanel.
    From other posts, it seems that just MAT is enabled for the tracking. Is this correct?
    Also, from a technical perspective, what is it needed to set the tracking in place? Any type of code I should pass to my tech team?
    Best,
    Carola

    No, not without help from the thief.

  • Conversion tracking for newsstand app and single folio

    Hello Adobe,
    For my native ios and android apps i do use this web tool - http://www.distimo.com/conversion-tracking
    Adding a small sdk inside my app helps me to track app installs per different channels.
    My both newsstand apps build with dps are paid, so there is a special need to track the conversion. For now the only thing i have - is omniture statistics upon this products. The question is - do the omniture support this kind of tracking, and if not, is it possible to insert an 3rd parties SDK into my newsstand? And if it is possible, what should be my next steps.
    Hearst Russia

    DPS does not support integration with 3rd party SDK's. If the solution has a JavaScript API, there maybe a way to implement this. Take a look at this Devnet article which may be helpful:
    http://www.adobe.com/devnet/digitalpublishingsuite/articles/measure-app-promotion-success- by-campaign-id.html

  • AirPlay mirror on Apple TV stops working when a Skype or Google conversation is started (iOS 7)

    I thought it would be nice to see Skype contacts on the large screen and realised this should be possible using my Apple TV, but AirPlay (in mirror mode) on Apple TV stops working when a Skype or Google + conversation is started after showing all right on the TV till that point. I'm using iOS 7 and the problem occurs on my iPad 2 and iPhone 5. Facetime seems to be OK, and Skype works over Apple TV when using my daughter's MacBook Pro (though I haven't tried Google + on it), so I deduce that the issue is with iOS 7. I have had success one or twice with using Skype in this manner on my iPhone so it is not consistant, but this is rare and hasn't happened in my latest attempts. Unfortunately some of my Skype contacts don't have an Apple device so I often can't use Facetime.
    Is there a work around, or has Apple acknowledged this issue and said there will be a fix?

    Same problem here.
    iPhone 5s + apple TV + Skype all are up to date. Mirroring is working until the video signal starts, after that the Apple TV goes back to the Apple TV starting screen.

  • What are the dependent SCs to be added to the Track, to develop NW CE BPM

    Hello Gurus:
    We are creating a track in a NW 70 SP17 system to be used for NW CE 7.1 Ehp1 SP03 applications, like Business Process
    Management applications (Process Composer, Rules Composer). While creating the track, I chose the track template to be "Composite Application 7.1 (with Business Process Management)". And I added the following 14 dependent SCs to the development SC I added to the track.
    CAF01_0.SCA
    CAFMF01_0.SCA
    ENGFACADE01_0.SCA
    ENGINEAPI01_0.SCA
    EPBASIS01_0.SCA
    EPBASISAPI01_0.SCA
    EPBUILDT01_0.SCA
    ESF01_0.SCA
    FRAMEWORK01_0.SCA
    GPCORE01_0.SCA
    MMRSERVER01_0.SCA
    SAPBUILDT01_0.SCA
    VCFRAMEWORK01_0.SCA
    WDRUNTIME01_0.SCA
    But when as a Developer when I try to create a DC of type Process Composer, that project type is dummied or disabled ???
    Other project types like Composite Application, Web Dynpro etc are enabled and working fine.
    Question:
    Is it enough to add corresponding dependent SCs related to Business Process Management ? If so what are those SCs ?
    (ii) If I need to choose another track template like " Business Process Management Application for NetWeaver 7.1" which is also available, then how could I have DC project of type Composite Application ?
    Appreciate your help,
    Prasad Nutalapati

    Satish:
    I am talking about creating DC projects of type 'Process Composer' for NW CE BPM applications, with in a track I created using a certain template I mentioned. How would that relate to NW Dev Studio ?
    To answer your point, when I try to create a local DC project of type 'Process Composer', yes I was able to, no problem. Because the NWDS is from the same CE Server installation files (7.1 Ehp 1 SP00).
    Thanks,
    -Prasad

  • How to display modified condition base value in Pricing Procedure?

    Hi everyone:
    I used a formula to change the condition base value (via the VOFM transaction) of various price conditions that are assigned to the same material. In this way, I can distribute the total quantity of the item line in smaller quantities for each price condition.
    Now the problem is that in the conditions tab of the sales order, I can not see the Condition Base Value of each Price Condition, and that's a little confusing.
    Did Anyone know's a way to show the modified Condition Base Value in the Pricing Procedure of the Condition Tab?
    Thanks a lot,
    Ginno Giuffra

    Thanks JJ:
    Yes,  I can found the modified base value in the condition details, but I still need to show it in the Pricing Procedure scheme.
    It is curious that the table options does not allow you to add that field to the escheme.
    Does anyone knows a user exit wich can modifye the table?
    Thanks again,
    Ginno Giuffra

  • On Firefox 3.6.x on Mac and Windows, Google Analytics tracking code leads to an Error 400 page

    Our business sent out an email campaign that has several links containing Google Analytics tracking code in the URL.
    In the tracking code, which is automatically generated via the email campaign software, is an em-dash. The URLs works in every browser (Google Chrome, Safari, Windows) and in older versions of FireFox. They do not work in 3.6.x versions of FireFox in both Mac and Windows.
    As a result, when customers click on a link in the email, they get a page that says "HTTP Error 400 - request is badly formed" because FireFox interprets the em-dash as garbage.
    Once this error occurs none of the pages in the site can be accessed unless a specific cookie is removed.
    Seeing how many people do not know how to clear cookies - it is especially cryptic in the Windows version of FF 3.6.10 - what are the chances that there will be a release of Firefox to remedy this problem? And is there anything else that could be done?

    Weird. We are having this same problem as well. Ours happens in Chrome as well. What I have figured out is -at least for us - is its somethign to do with the Google Analytics tracking cookie on our site. If I go to cookies and then delete the _umtz cookie, the site will load fine. In the time being I have set "pageTracker._setCampaignTrack(false); " in our tracking code to keep the script from dropping the cookie in users browsers.

  • How to send file to FTP on conditional basis.

    Hi SAP Guru's,
    Can somebody please tell me how to create a file on conditional basis in FTP.
    My requirement is that I have to create a file in different directory according to the sender port field.
    Interface
    IDOC -
    > XI -
    > File
    SNDPRN(DGE008,DGE006,..............) now I need to create the file according to the SNDPRN field.
    Example
    SNDPRN (DGE006)----
    > Target (DGE006/xyz/abc/filename.xml)
    SNDPRN (DGE008)----
    > Target(DGE008/xyz/abc/filename.xml)
    Also how do I send the data to the specific directory because I only get the SNDPRN(DGE008) from the idoc but how to send the data to /xyz/abc/ directory.
    I have tried dynamic configuration but it is not working.
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String MyDirName=DirName;
    String ourSourceFileName = conf.put(key,MyDirName);
    return "";
    Error in Adapter Monitoring
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
    CAN SOMEBODY PLEASE HELP ME.
    Edited by: Muhammad  iqbal on Jul 12, 2010 3:04 PM

    Off course I did.
    I have done the following in Int Rep.
    Step 1,
    Create an udf for dynamic configuration and mapped it with the MT
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String MyDirName=DirName;
    conf.put(key,MyDirName);
    return "";
    Steps in Int Dir
    Target Directory: /
    File Name: filename.xml
    Use Adapter Specific Message Attribute = checked
    Fail if Adapter Specific Message Attribute missing = checked
    Directory = checked
    Error in Adapter Monitoring
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
    CAN SOMEBODY HELP ME IN THIS MATTER.

  • Can I insert facebook conversion tracking code in adobe muse?

    Can I insert facebook conversion tracking code in adobe muse? If so, exactly where and how do I do so? Thanks!

    Hello,
    As per the instructions on link below you need to insert the code in <Head> section of the page.
    Conversion Tracking and Optimization | Facebook Help Center | Facebook
    Once you receive the code from Facebook you can insert it in Muse site.
    Open the page in Design mode and go to Page > Page Properties > Metadata > Html for <head>
    Paste the code in the space mentioned in the screenshot and you should be all set
    Regards
    Vivek

  • VOFM: Condition Base Value(Urgent)

    Hi All,
    I created  Condition Base Value and transported it with a breakpoint. In the revision I removed the breakpoint but there was syntax error so object was not imported and the error shown for transport was 8. In another try an error occured again. In last import, everything went fine but the condition base value include program is not updated. it is remianing in the last state.
    Do I need to do something extra or there is problem in the steps I am following.
    Regards
    Vijai

    Hi,
    Now make sure that break points are removed and activate the routine by running RV80HGEN program in SE38.After this transport the fresh request.
    Reward points if useful
    Regards,
    Amrish Purohit

  • Alternative formula for condition base value in cross-application

    Hi,
    I need inputs regarding an issue as:-
    In "TAXINJ" Tax pricing procedure, for a ZXXX  excise related condition type the alternate condition base value (Alternative formula for condition base value) must be of  YXXX condition type of MM Purchase pricing Procedure.
    How to acheive Alternative formula for condition base value in cross-application area as both condition type belongs to different Application area i.e.  ZXXX belongs to TX and YXXX belongs to M.
    One way or only way is thro' routine but I do not know How it works? 
    Thanking you.
    Prashant

    routine is only the best way for u in this case
    u will have to use subtot may be 6 or 4 in MM pricing procedure
    and write a routien in Tax procedure, i n that u will have to write a code where in ur sustem will featch this value in sub total and act a a base for ur cond type in Tax proc for ue condition type.
    what is your excat requirement
    there might be other work around that can help u around
    hope this works
    or write t routines one in MM and Other in Tax proc for ur issues

Maybe you are looking for