Page 1 of 1
ShareASale Affiliate Marketing include
Posted: Wed Nov 05, 2008 1:02 pm
by William_firefold
I have been racking my brain trying figure out how to do this in Able but have had no luck.
We have an affiliate marketer we want to use and they are going to have tracking access to our orders when they complete. The problem is that their tracker is an image with image src= a link with GET params in it. How can I output a 1x1 px image with a image src with variables from able in the url. Example below:
Code: Select all
public string MakeShareASaleString(){
return("<IMG width=\"1\" height=\"1\" SRC='https://shareasale.com/sale.cfm?amount="+ Order.TotalCharges.ToString() +"&tracking="+_OrderId.ToString()+"&transtype=sale&merchantID=#####\'>");
}
This is what they gave us. All it has to do is appear on the page.
Code: Select all
<img src="https://shareasale.com/sale.cfm?amount=AMOUNTOFSALE&tracking=TRACKINGNUMBER&transtype=TYPEOFTRANSACTION&merchantID=#####" width="1" height="1">
Re: ShareASale Affiliate Marketing include
Posted: Thu Nov 06, 2008 6:47 am
by mazhar
Give a try and create property into your page as below
Code: Select all
public string GetImage
{
get
{
string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + order.TotalCharges.ToString() + "&tracking=" + order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
return image;
}
}
and then you can put the image into the page as below
Re: ShareASale Affiliate Marketing include
Posted: Thu Nov 06, 2008 7:47 am
by William_firefold
This worked. Thank you very much.
Note: I had to use _Order instead of order
Code: Select all
string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=####\" />";
Re: ShareASale Affiliate Marketing include
Posted: Fri Nov 14, 2008 7:16 pm
by kwanzz
I have the same problem. Did you simply go to "Administration > Website > Content and Layout > Edit Scriptlet" in the Merchant admin and put both sets of code that mazhar provided into the content section of the receipt page?
Re: ShareASale Affiliate Marketing include
Posted: Sat Nov 15, 2008 5:06 am
by mazhar
I have the same problem. Did you simply go to "Administration > Website > Content and Layout > Edit Scriptlet" in the Merchant admin and put both sets of code that mazhar provided into the content section of the receipt page?
No this needs to be placed in
ConLib/Recieptpage control. First edit the
ConLib/Recieptpage.ascx.cs file and find following lines of code
Code: Select all
private int _OrderId;
private Order _Order;
then add the below code just under them
Code: Select all
public string GetImage
{
get
{
string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
return image;
}
}
Save the file and then edit the
ConLib/RecieptPage.ascx file and place the image code where you want to show the image for example you can place it just under the following line of code
Code: Select all
<%@ Register Src="~/Checkout/AffiliateTracker.ascx" TagName="AffiliateTracker" TagPrefix="uc" %>
like
Code: Select all
<%@ Register Src="~/Checkout/AffiliateTracker.ascx" TagName="AffiliateTracker" TagPrefix="uc" %>
<% = GetImage %>
Re: ShareASale Affiliate Marketing include
Posted: Mon Nov 24, 2008 8:10 pm
by kwanzz
I had managed to get it to work with a little trial and error but thanks for the reply!
Re: ShareASale Affiliate Marketing include
Posted: Tue Feb 10, 2009 10:33 am
by AlexG
Re: ShareASale Affiliate Marketing include
Posted: Mon Mar 02, 2009 12:50 pm
by Opeyemi
Does "_Order.TotalCharges.ToString()" include shipping & sales tax? If it does, what is the variable without shipping & sales tax?
thanks
Re: ShareASale Affiliate Marketing include
Posted: Tue Mar 03, 2009 11:49 am
by mazhar
Opeyemi wrote:Does "_Order.TotalCharges.ToString()" include shipping & sales tax? If it does, what is the variable without shipping & sales tax?
thanks
Code: Select all
OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
LSDecimal totalExcludingShippingAndTaxes = order.Items.TotalPrice(orderItemTypes);
Re: ShareASale Affiliate Marketing include
Posted: Tue Jul 28, 2009 12:31 am
by archeie
I modified the two pages mentioned above with your coding, but im stuck on modifying the code to not include sales tax or shipping in the total price calculation.
I put the following code inside page ConLib/Recieptpage.ascx.cs
Code: Select all
public string GetImage
{
get
{
string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + _Order.TotalCharges.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
return image;
}
}
and the following code in ConLib/RecieptPage.ascx
However can you explain exactly how we modify the coding to not include the shipping or sales tax figures in the total pricing calculation. where do we put the following code to not include sales tax or shipping
Code: Select all
OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
LSDecimal totalExcludingShippingAndTaxes = order.Items.TotalPrice(orderItemTypes);
Re: ShareASale Affiliate Marketing include
Posted: Tue Jul 28, 2009 3:50 am
by mazhar
Try following code
Code: Select all
public string GetImage
{
get
{
OrderItemType[] orderItemTypes = new OrderItemType[]{OrderItemType.Charge,OrderItemType.Coupon,OrderItemType.Credit,OrderItemType.Discount,OrderItemType.GiftCertificate,OrderItemType.GiftCertificatePayment,OrderItemType.GiftWrap,OrderItemType.Handling,OrderItemType.Product};
LSDecimal totalExcludingShippingAndTaxes = _Order.Items.TotalPrice(orderItemTypes);
string image = "<img width=\"1\" height=\"1\" SRC=\"https://shareasale.com/sale.cfm?amount=" + totalExcludingShippingAndTaxes.ToString() + "&tracking=" + _Order.OrderId.ToString() + "&transtype=sale&merchantID=#####\" />";
return image;
}
}
Re: ShareASale Affiliate Marketing include
Posted: Tue Feb 16, 2010 6:26 pm
by mpullmann
I do not know where is the problem - I did all the step but the pixel is not outputted at "thank you" page. It looks like <% = GetImage %> doesn't call anything even I created function GetImage in ReceiptPage.aspx.cs file. Am I doing something wrong?
Re: ShareASale Affiliate Marketing include
Posted: Wed Feb 17, 2010 9:59 am
by mazhar
mpullmann wrote:I do not know where is the problem - I did all the step but the pixel is not outputted at "thank you" page. It looks like <% = GetImage %> doesn't call anything even I created function GetImage in ReceiptPage.aspx.cs file. Am I doing something wrong?
I have posted a widget for PostAffiliatePro here in this thread
viewtopic.php?f=42&t=13217&p=56881#p56881
Re: ShareASale Affiliate Marketing include
Posted: Wed Feb 17, 2010 4:49 pm
by mpullmann
Thanks Mazhar, you're a king
But, could you tell me why previous solution didn't work for me?
Re: ShareASale Affiliate Marketing include
Posted: Thu Feb 18, 2010 5:14 am
by mazhar
I don't know may be you have missed something if you were trying to copy/paste it. The information you updated above shows that ASP.NET was unable to parse the script and was considering it text.
Re: ShareASale Affiliate Marketing include
Posted: Tue Jun 01, 2010 8:42 am
by mazhar