Posted: January 18, 2013 at 1:34 pm
|
We’re setting up tracking for affiliates, but I’m not sure which page to track. We tried setting it to the [ESPRESSO_PAYMENTS] page but that’s not tracking well. Should we put it in the page with [ESPRESSO_TXN_PAGE]? |
Hi Jess, I’m imagining that you would only want to run the affiliate tracking code if the payment is complete, is that correct? If so, I would suggest adding the affiliate tracking code in return_payment.php, which is a template file that can be copied over to /wp-content/uploads/espresso/templates so that it doesn’t get overwritten on an update. I would try putting the code within the block of code that runs if the payment status is complete, which is right on line 13:
One thing to keep in mind about copying templates over to /wp-content/uploads/espresso/templates. If we change something in a template in a future version, the updated code will need to be copied into the customized template. I usually recommend leaving a reminder note for when you update Event Espresso to check for changes made to the templates that were customized. |
|
|
Thank you Josh! Actually we’re just using Google Analytics for tracking, so I have to give it an actual page URL that’s hit when payment is complete. The page with [ESPRESSO_EVENTS] appears to be used multiple times, and you’re right, we only want to track completed payments. Would analytics pick up on the [ESPRESSO_TXN_PAGE] if it’s used by the system? |
The page with the [ESPRESSO_TXN_PAGE] shortcode isn’t viewed in a browser when someone pays for event registration, so no, analytics will not be able to track it. It’s only used as an IPN listener by a few of the gateways included with Event Espresso. Usually there’s tracking code that can be placed on a receipt page, at least there is with the Ecommerce tracking feature of Google Analytics. Is there any option to use tracking code? |
|
|
Ok thank you for explaining that! So in return_payment.php around line 13 I pasted in our analytics code. Google requires certain information to be returned for e-commerce tracking, and I pulled the values for the transaction ID and cost, etc, from the sample given in affiliate_tracking.php. Is that ok? One other question: we have GA already inserted within the head of all pages. And the code that I put into the template is the full GA code again. Will it still work, even if it might show up more than once to GA? And will it work even though it doesn’t look like it’s going into the head? Here’s the code that I placed in:
|
|
Oh I see, my php was removed. Here it is again:
|
|
Nope still not working. I’m so sorry. Anyway I did a php echo $txn_id and $total_cost |
|
Well it’s not tracking in GA so I moved the new GA code to the main header.php file and ran a test transaction. The variables that need to be displayed in the GA code aren’t showing up, and I’m not sure how to echo them properly. How do I echo the transaction ID in the header.php file? When I view the source of the final transaction page here’s what shows:
|
Hi Jess, Maybe this post will help? It is a similar concept: |
|
The support post ‘Affiliate tracking code – which page?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.