Loaded Commerce Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: How do I insert Order ID into tracking code needed for ads?
PostPosted: Wed Nov 09, 2011 9:26 pm 
Offline
CRE Talented
User avatar

Joined: Thu Jan 31, 2008 12:58 am
Posts: 413
Location: Denver, CO
I am starting an ad campaign that's a banner ad campaign and it's being run through the banner campaign part of PriceGrabber which is called P3.

The issue is I want to be able to track how many sales I'm making through banner ads. In order to do this I need to insert tracking code into the order confirmation page. I have already inserted it into a file that's part of CRE Loaded 6.4 that is the order confirmation file. That way when a sale is completed it notifies PriceGrabber. We already have the regular tracking code inserted there that PriceGrabber uses for their standard system so we can tell how many sales we're making off of our clicks. That is installed and appears to be working correctly so I don't think we need help there.

Here is the issue. As part of this tracking code I need to have a unique/random number inserted into part of the code. Now without this being done I will still be able to run my campaign but the issue is I can't find out how many clicks are converting to sales. I was told I can input a static number in the field and it may still work but the idea of a random number is it decreases the chances of errors such as two different sales on my website being shown on PriceGrabber's side as one sale.

They are asking for an OrderID and I believe I can use any number. It does not have to be the actual order number but the order number would be a good one. The code is below and also the instructions. What can I put in place of OrderID in those brackets that will pull a number in from my website?

Here is the code:

2. In order to defeat caching and ensure accurate counts, it is required that a number be inserted into the ord= key-value of the tag. This value cannot contain semicolons or special characters and should be random.

<!-- Start of DoubleClick Spotlight Tag: Please do not remove-->
<!-- Activity name for this tag is:AVCDistributor_Spotlight -->
<!-- Web site URL where tag should be placed: http://www.avcdistributor.com/ -->
<!-- Creation Date:11/9/2011 -->
<IMG SRC="http://ad.doubleclick.net/activity;src=3421677;type=avcdi190;cat=avcdi736;qty=1;cost=[Revenue];ord=[OrderID]?" WIDTH=1 HEIGHT=1 BORDER=0>
<!-- End of DoubleClick Spotlight Tag: Please do not remove-->


Thank you for your help with the above.


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Thu Nov 10, 2011 5:55 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
http://creloaded.org/forum/82/35572.html

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Thu Nov 10, 2011 5:51 pm 
Offline
CRE Talented
User avatar

Joined: Thu Jan 31, 2008 12:58 am
Posts: 413
Location: Denver, CO
Hello Simon,

Thank you for your reply. I saw you mentioned about looking at the Print Invoice in that post but I am sure that was for the Order Total and not for the Order ID which is what I need.
Correct me if I'm wrong though and if necessary I will look at the Print Invoice.
I believe you are referring to the following link:

<?php echo $_GET['order_id']; ?>

The biggest issue I have is how do I use that? If I am correct that line will simply print the Order ID such as if I want to have the Order ID displayed on my Order Confirmation page for example.
Will this work with the need that I have though and for it to send it as part of the tracking code?
I know I have the field that says [OrderID]. It appears thy are very particular about what goes in this field.
Would I put that entire line (php echo, etc) in those brackets? I'm not sure if that would work though because of their rules.
Do I simply put that line in addition to the tracking code? If I do that would it automatically make the tracking code then substitute that number for the order ID that's in brackets and I would then keep the OrderID just as it is, [OrderID]

Sorry about all the questions. I'm still kind of new to PHP so am learning as I go along.

Thank you.


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Thu Nov 10, 2011 7:26 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Print invoice has both order total (which I assume is the 'cost' value they're looking for) and the Order ID (else it would be an invoice with an order reference, not so good.)

The key lines out of printorder.php are:
Code:
require(DIR_WS_CLASSES . 'order.php');
  $order = new order((int)$_GET['order_id']);


This sets up the class, so you can then use $order->totals to get the total of the order.
Have a look at the order class in /includes/classes/order.php for more.

So which page are you sticking this code in? checkout_confirmation or checkout_success? both have pros/cons in terms of measuring anything.

just try things out and check the page source for the numbers - you'll figure it out.

simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Thu Nov 10, 2011 9:04 pm 
Offline
CRE Talented
User avatar

Joined: Thu Jan 31, 2008 12:58 am
Posts: 413
Location: Denver, CO
Fortunately the code that I need to make the changes to only needs the Order_ID. It doesn't need the order totals.

The part of the code where the order id goes is:

<IMG SRC="http://ad.doubleclick.net/activity;src=3421677;type=avcdi190;cat=avcdi736;qty=1;cost=[Revenue];ord=[OrderID]?" WIDTH=1 HEIGHT=1 BORDER=0>

I guess I'm confused about what I need to do with that. Do I keep the OrderID in the brackets and just set it up elsewhere so that it's known what the OrderID is or do I need to place some code in place of the OrderID between the brackets?

For example would the line <?php echo $_GET['order_id']; ?> be added to the code that I put at the beginning of this post or do I put that between the brackets?

I looked at the file order.php but is that only for the order totals or would I use that for the OrderID?

The file that I'm putting it in is checkout_success.tpl.php.

I hope the above makes sense. I'm kind of confused and still am learning this. I appreciate your help.


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Fri Nov 11, 2011 12:07 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Try:

Code:
<IMG SRC="http://ad.doubleclick.net/activity;src=3421677;type=avcdi190;cat=avcdi736;qty=1;cost=[Revenue];ord=[<?php echo $_GET['order_id']; ?>]?" WIDTH=1 HEIGHT=1 BORDER=0>

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Fri Nov 11, 2011 1:40 am 
Offline
CRE Talented
User avatar

Joined: Thu Jan 31, 2008 12:58 am
Posts: 413
Location: Denver, CO
Thanks Simon. I just made that change. I won't know for sure yet if it's working but I'm going to speak with PriceGrabber on the other side and see if they can tell me that it's sending unique order numbers. Hopefully this resolved it. Thank you again.


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Fri Nov 11, 2011 1:47 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Well, you should be able to see it on the checkout_success.php page - place a test order and look in View Source at the page's code for your pricegrabber line you mention above ... if you're getting the order id appearing in the [ ] area you want, it'll be fine.
Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: How do I insert Order ID into tracking code needed for ads?
PostPosted: Fri Nov 11, 2011 3:20 am 
Offline
CRE Talented
User avatar

Joined: Thu Jan 31, 2008 12:58 am
Posts: 413
Location: Denver, CO
Thank you. I just did exactly what you said and it appears that that fixed it and sure enough in that section it is showing the order number. Thank you again!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

Board index » CRE Loaded Support » CRE Loaded 6.4

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 24, 2012 3:07 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy