IMPORTANT *It is not recommended that you try to complete this setup without instruction from the Everflow team or from your dev team. Failure to place the code directly could result in your whole website going down. *

Step #1

Click Script

For the click setup please add the header and footer plugin found here

In the Everflow JS SDK section on the offer page copy the Click code and paste it into the Footer.

You can get to the Footer section inside the Header and Footer plugin by going to Settings > Header and Footer Scripts in your Wordpress account:

Step #2

Conversion Script

Prepare your conversion script.

add_action( 'woocommerce_thankyou', 'my_custom_tracking' );

function my_custom_tracking( $order_id ) {
// Lets grab the order
$order = wc_get_order( $order_id );

// Determine if any coupons were used for this transaction
$coupons = "";
$couponCount = 0;
foreach ($order->get_used_coupons() as $coupon) {
$couponCount++;
if($couponCount > 1) { // do not add comma unless more than one coupon
$coupons .= ',';
}
$coupons .= $coupon;
}

$javascriptCode = '<script type="text/javascript" src="https://INSERT_TRACKING_DOMAIN/scripts/sdk/everflow.js"></script>
<script type="text/javascript">
EF.conversion({
aid: INSERT_ADVERTISER_ID,
amount: '.($order->get_total() - $order->get_shipping_total()).',
order_id: "'.$order_id.'",
coupon_code: "'.$coupons.'",
adv1: "", //Optional
adv2: "", //Optional
adv3: "", //Optional
adv4: "", //Optional
adv5: "", //Optional
email: "'.$order->billing_email.'",
});
</script>';

echo $javascriptCode;
}

_________________________________________________________________

Please replace INSERT_ADVERTISER_ID with the advertiser ID, this can be found under Offers > Manage > Click the Offer Page Here:

In this case you would use 139 in that spot.

Please replace INSERT_YOUR_TRACKING_DOMAIN with the tracking domain found under Offers > Manage > Click the Offer in the JavaScript SDK section here:

In this case you would use: https://www.serve-eflow-test.com

Please note that your domain will be different.

Step #3

After you have completed Step #2 please create your functions.php url (so you can edit the page).

First copy your store domain:

In this example mine is https://www.ef-wp-test.com/

DOMAINwp-admin/theme-editor.php?file=functions.php

In this example my domain will be:

https://www.ef-wp-test.com/wp-admin/theme-editor.php?file=functions.php

Once you successfully navigate to that url please scroll all the way down to the bottom of the page and input the code, like this:

Then hit "Update File" at the bottom of the screen:

Step #4

Please then generate a test link from Everflow and test to see if a sale tracks back to our system. If you need assistance please reach out to Everflow support

_____________________________________________________________

NEED HELP? OUR CUSTOMER SUCCESS TEAM IS HERE FOR YOU!

We've assembled a superstar team of industry veterans that are available around the clock to make sure that your issues are resolved and questions are answered. You can reach out any time in-platform via Chat or by emailing support@everflow.io.

Did this answer your question?