Usage:

This module is the automated version of the [mbr_math] shortcode and is designed to allow you to query a contact field in your ActiveCampaign application, perform a simple math operation on it and store the result in ActiveCampaign.

This module can be called through a “Webhook” in an automation.

This module can be called manually by typing the URL in your browser.

Parameters:

mbr_math=SECURITY_CODE Specifies the action to perform (see note 1).
field=fieldname1 Specifies the name of the field used to perform the operation.
target=fieldname2 Specifies the name of the field in which to store the results of the operation.
If not specified, it defaults to the name provided in “field”.
value=234.50 Specifies the value of the second operand in the operation.
If the name of a valid ActiveCampaign contact field is entered, that value will be used instead.
operation=add Specifies the math operation to be performed. Valid operations are:
add, sub (subtract), div (divide), mul (multiply), pow (power), mod (modulus), sqr (square root), max (maximum), min (minimum).
round=2 Specifies the number of decimal digits to round the result of the operation to. If a positive value is provided the rounding will occur after the decimal point, if a negative value is provided the rounding will occur before the decimal point. Halves are always rounded up. (0, which is the default if this parameter is not defined, means any value will be rounded to an integer).
decimal=0 Specifies the number of decimals places to store back into ActiveCampaign (0, which is the default if this parameter is not defined, means any value will be rounded to an integer).

Example:

1. The value of field “fieldname1” will be multiplied by 39.95 and stored back in ActiveCampaign with 2 decimals after rounding to the hundredth.

2. The value of field “fieldname1” will be multiplied by 39.95 and stored back in ActiveCampaign with 2 decimal after rounding to the hundredth in field “fieldname2”.

3. The value of field “fieldname1” will be multiplied by the value of “fieldname2” and stored back in ActiveCampaign with 2 decimal after rounding to the hundredth in field “fieldname3”.

Note:

1) In all examples provided, “SECURITY_CODE” stands for one of the validation codes you defined in “ActiveMember360 >> Plugin Options >> Main Settings >> Security Codes” These are used to authenticate the request.

2) If you going to use this module as a webhook as part of an automation, you need to add &Id=%SUBSCRIBERID% to your URL as shown above in our examples.

You can also perform this action manually in your browser, in this case you have to enter the correct Id i.e. &Id=99 of the desired ActiveCampaign record.