Title: Donation ID Code Expression
Last modified: October 3, 2019

---

# Donation ID Code Expression

 *  Resolved [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * (@nabeel13)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/donation-id-code-expression/)
 * Hi,
 * I hope you are well.
 * I have set up Google Ads donation conversion tracking with Google Tag Manager.
 * However, to avoid counting duplicate conversions I need to enter a dynamic order
   ID to Google Tag Manager.
 * What is the Donation ID code expression that I can use (for example: `<%= orderId%
   >` )?
 * Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdonation-id-code-expression%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [gsamsmith](https://wordpress.org/support/users/gsamsmith/)
 * (@gsamsmith)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12039710)
 * Hi there,
 * The best place to start looking for the Donation ID is in the $_POST variable
   on the Donation Confirmation page.
 * Doing a var_dump($_POST); on the Donation Confirmation page will show you all
   the information available, and then you can populate your variables as needed.
 * Thanks!
 *  Thread Starter [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * (@nabeel13)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12042748)
 * Hi gsamsmith,
 * Thank you for your assistance.
 * However, I don’t know how to debug php or how to do a `var_dump()`.
 * Can this be accomplished with Google Chrome developer tools?
 *  [gsamsmith](https://wordpress.org/support/users/gsamsmith/)
 * (@gsamsmith)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12054574)
 * Sure thing, happy to help.
 * We’ve actually written an article that shows how to query donor information, 
   and the final code snippet has a var_dump example of getting all that information
   displayed out on a page.
 * Here’s the link to that:
    [https://givewp.com/documentation/developers/how-to-query-donor-information/](https://givewp.com/documentation/developers/how-to-query-donor-information/)
 * Have a great rest of your day!
 *  Thread Starter [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * (@nabeel13)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12057312)
 * Hi gsamsmith,
 * Thank you for for the support article and please forgive my non-technical use
   of coding terminology.
 * However, I am not trying to query specific donor information,
    but rather, I 
   am trying to get the code that is added to the page that generates the donation
   ID.
 * For example, this would be the code added to the donation confirmation page:
 * `'donation_id': '<%= orderId %>',`.
 * When a user completes a donation, the code would be updated as below:
 * `'donation_id': '123456',`.
 * So what I am trying to get is not the donation ID “123456”, but rather, the code
   that generates the donation ID, such as, `<%= orderId %>` (As explained in this
   article [Use an order ID to minimize duplicate conversions](https://support.google.com/google-ads/answer/6386790)
   ).
 * I cannot get the code on the WordPress website because GiveWP uses a shortcode
   to generate donor information on the donation confirmation page and the information
   displayed on a completed donation would only be the generated donation ID such
   as “123456”.
 * Please can I have the placeholder code that you use to generate variable donation
   IDs such as `<%= orderId %>`?
 * Thank you for your assistance.
 *  Thread Starter [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * (@nabeel13)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12087450)
 * Hi gsamsmith,
 * Is this the code that used to generate the donation ID
 * `donation_id:t.getAttribute("data-donation-key")`?
 * Specifically `"data-donation-key"`?
 * Thank you.
 *  [gsamsmith](https://wordpress.org/support/users/gsamsmith/)
 * (@gsamsmith)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12353480)
 * Hi there,
 * The variable that holds the donation ID is “$donation_number”.
 * Here’s a link to the line of code that outputs this ID onto the donation confirmation
   page:
 * [https://github.com/impress-org/givewp/blob/6678bf4694069cb7582dd07cd47e2d131c9a2d29/templates/shortcode-receipt.php#L86](https://github.com/impress-org/givewp/blob/6678bf4694069cb7582dd07cd47e2d131c9a2d29/templates/shortcode-receipt.php#L86)
 * Because Give uses sequential ordering, an ID is assigned to keep the donations
   ID’s in numerical order. Here’s an article on this as well:
    [https://givewp.com/documentation/core/settings/general-settings/sequential-ordering/](https://givewp.com/documentation/core/settings/general-settings/sequential-ordering/)
 * Thanks.
 *  Thread Starter [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * (@nabeel13)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12367823)
 * Hi gsasmith,
 * Thank you for your invaluable assistance.
 * I really appreciate it.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Donation ID Code Expression’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [order id](https://wordpress.org/support/topic-tag/order-id/)

 * 7 replies
 * 2 participants
 * Last reply from: [nabeel13](https://wordpress.org/support/users/nabeel13/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/donation-id-code-expression/#post-12367823)
 * Status: resolved