Plugin Directory

Changeset 719446


Ignore:
Timestamp:
05/28/2013 04:28:56 PM (13 years ago)
Author:
conductrics
Message:

Version 0.2.8 - Support for 'Point on Page' in Web Actions setup.

Location:
conductrics-webactions/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • conductrics-webactions/trunk/conductrics-webactions.php

    r718074 r719446  
    33    Plugin Name: Conductrics Web Actions
    44    Description: Includes Conductrics Web Actions scripts in your pages, which makes it easy to test changes to your pages, track their success, and do dynamic targeting.
    5     Version: 0.2.7
     5    Version: 0.2.8
    66    Author: Conductrics
    77    Author URI: http://conductrics.com
  • conductrics-webactions/trunk/includes/wa-runtime.php

    r712473 r719446  
    1111            }
    1212            $agents = $this->get_relevant_agent_codes( $account_options );
    13             foreach ( $agents as $agentCode ) {
    14                 $this->include_script_for_agent( $agentCode, $account_options );
    15             }
     13            $agentCodes = implode(",", $agents);
     14            $this->include_script_for_agents( $agentCodes, $account_options );
    1615        }
    1716
    18         function include_script_for_agent( $agentCode, $account_options ) {
     17        function include_script_for_agents( $agentCodes, $account_options ) {
    1918            # Bail early if required info missing
    20             if ( empty($agentCode) || empty($account_options) ) {
     19            if ( empty($agentCodes) || empty($account_options) ) {
    2120                return;
    2221            }
     
    2524                $baseurl = "http://api.conductrics.com";
    2625            }
    27             $owner = $account_options['owner'];
    28             $apikey = $account_options['apikey'];
    29             $wa_styles_alias = "conductrics-wa-${agentCode}";
    30             $wa_styles_url = "$baseurl/$owner/$agentCode/web-actions-css?apikey=$apikey";
    31             $wa_script_alias = "conductrics-wa-${agentCode}";
    32             $wa_script_url = "$baseurl/$owner/$agentCode/web-actions?apikey=$apikey";
    33             // Include the styles for this web action
    34             wp_enqueue_style(
    35                 $wa_styles_alias,
    36                 $wa_styles_url
    37             );
     26            $owner = urlencode($account_options['owner']);
     27            $apikey = urlencode($account_options['apikey']);
     28            $agentCodes = urlencode($agentCodes);
     29            $wa_script_alias = "conductrics-wa-script";
     30            $wa_script_url = "$baseurl/$owner/-/web-actions?apikey=$apikey&decisions-for-agents=$agentCodes";
    3831            // Include the script for this web action
    3932            wp_enqueue_script(
     
    4134                $wa_script_url,
    4235                array('jquery'), # WP will make sure jQuery is included for us
    43                 false, # version
    44                 true # we want to be placed in the footer
     36                false, # version could be specified here
     37                false # we don't want to be placed in the footer
    4538            );
    4639        }
Note: See TracChangeset for help on using the changeset viewer.