marketo loop velocity script to display product interest for a Lead - velocity

I am trying to code an email velocity script in Marketo to list all ProductInterest a lead has in an email, we have a total of 125 products as a custom {{my.token}}.
I want the script to Display ONLY the $ProductName a Lead has if the $Type=Invested
ProductInterest is a custom object. ProductName and Type are sub parts of ProductInterest
custom object
a Lead can have any number of Products associated with his account I am only interested in products in which Lead has "Invested".
The end result I am looking at is,
Dear John Doe,
Based on your interest in products A,B,C,D...... we are sending you this email.
The scripted token needs to populate A,B,C,D....
Thanks for the help in advance....
I made this code,
#foreach ($ProductName in $ProductInterestList)
#if($ProductName.Type == "Invested")
<p><strong>$ProductName.ProductName</strong></p>
#end
#end
Problem with this solution is it is listing every product in the list and NOT the ones the lead is associated with which have Type as "Invested". Anyone help with this is much appreciated.
Please note I am a novice in Velocity scripting. Thank You

I figured it out, heres the code
#foreach ($ProductName in $ProductInterestList)
#if($ProductName.Type == "Invested")
<p><strong>$ProductName.ProductName</strong></p>
#end
#end

Related

GA4: total revenue is 0 and Monetization screen not showing data

I'm trying to integrate ecommerce tracking to a website. The problem is the events are captured and I'm sending all the data.
This is the data I'm sending
{"event":"purchase","currency":"EUR","value":21.85,"items":[{"item_id":"3cd937-debc-416d-955f-8ccc84a751","item_name":"anuy-namer","affiliation":"","coupon":"","currency":"EUR","discount":0,"index":1,"item_brand":"Fontastic","item_category":"THeadset / Lautsprecher","item_category2":"Unterhaltungk - Körer","item_category3":"","item_category4":"","item_category5":"","item_list_id":"31baa491-4c6f-8671-c808f0cb2100","item_list_name":"Fontastic BT In-Ear Headset S1 blau Bluetooth-Kopfhörer","item_variant":"Mit Begleiterliche Musikfans.","location_id":"","price":14.95,"quantity":1}],"transaction_id":"9826314a-46af-4304-a057-dc77f4a799b0","affiliation":"446c6345-9193-4841-9f4a-e06e8cf7220e","tax":"3.4917","shipping":"6.9000","coupon":"","gtm.uniqueEventId":12}
tbh I'm not sure if the data is wrong but the monetization reports only show number of purchasers and not anything else. It's all zeros. in the conversion screen the total revenue is not calculated.
Check if you have been given permission to see revenue. When someone gives you access, there are several options including one to hide revenue.
It turned out that the setup wasn't correct. I needed to add custom trigger to the events so It can be captured.
I also found some problem with the structure of the object, (currency,value , items) needed to be added inside ecommerce object.

getAllPrebidWinningBids() returns something but getAllWinningBids() is empty

I've been struggling with pbjs and DFP for several days now and my current problem is the one described in the title: when I type pbjs.getAllPrebidWinningBids() in the console, something is returned but nothing is displayed on my test page, and when I type pbjs.getAllWinningBids(), an empty array is returned and I don't get why.
A few more info :
This is a test page on our server with no other competition;
We use custom price buckets;
In DFP, I have 5 line items from 0.00€ to 2.00€ (so a 0.50€ increment) that matches the custom price buckets in the code;
The bids are "redirected" in the correct price buckets;
The code works and an ad is displayed when I set up a self-promotion
campaign in DFP with a prebid snippet as a creative, so I suppose
that something is wrong with the price buckets.
Would someone have an idea of what is blocking the selection of the bid and the rendering?
Thanks!
EDIT : I've come to realize that it was actually a normal behaviour since pbjs.getAllPrebidWinningBids() returns the bids that won the auction but haven't rendered on the page yet, while pbjs.getAllWinningBids() returns those that won but have also rendered.
So my question now is why the hell is no ad rendered at all?!
Here's my code (with a few dummy values), in case someone understand what's wrong: https://jsfiddle.net/8ewz9rgb/2/
Not answering the original thread question, instead your new issue why no ads are rendering. This is because you are calling GPT's googletag.disableInitialLoad. This will not render ads until googletag.refresh is called, which doesn't happen because it's in a 'pbjs' queue and you are not loading Prebid here, it is 404ing.

eBay SDK AddItem new ProductDetails EAN Requirements CANNOT List Or Revise

I've asked this question on an eBay forum already, but you have been very helpful, so probably worth posting here too.
Over the past few days I have realised that for many categories in which I sell, EANs are becoming required. I have been trying to update my eBay integration to take this into account, but have run into problems.
The additions to my code provide a workflow, and have problems as follows:
I sell musical instruments and accessories, so let's take a typical example a product "Boss CS-3 Compression Pedal", here's a link to a seller listing it: http://www.ebay.co.uk/itm/231547986565
The EAN is 4957054012854
I want to list this in "Musical Instruments > Guitars & Basses > Accessories > Effects Pedals" Category ID for this is: 41410
So, as I understand it, the first thing I need to know is whether EAN is a requirement for this Category. So, using the eBay .NET SDK I run a post to GetCategoryFeatures requesting the following feature IDs:
BrandMPNIdentifierEnabled,
EANEnabled,
UPCEnabled,
ISBNIdentifierEnabled
The response gives me, amongst other things:
EANEnabled: Required,
ISBNEnabled: Disabled,
UPCEnabled: Disabled,
BrandMPNIdentifierEnabled: False
This indicates to me that the EAN is a required ProductDetails value to include in the AddItem post.
So now I need to know if the EAN for this item exists in the eBay Catalogue, so I do a post to findItemsByProduct in the FindingService. I post to this URL:
http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=[MY-APP-ID]&OPERATION-NAME=findItemsByProduct&GLOBAL-ID=EBAY-GB&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&productId.#type=EAN&productId=4957054012854&paginationInput.entriesPerPage=1
The responses ack field is "Failure", which, from what I have gleaned from various internet posts tells me that the item is not found in the eBay Catalogue. Why? I don't know, as the listing example I give above shows the EAN in the Item Specifics fields... but anyway...
So, armed with this information, I can find only the advice that I should replaced the EAN value with a value returned from a post to GeteBayDetails, the value being found as ProductIdentifierUnavailableText which, in my instance (for eBay UK) reads "Does not apply".
Now, I build my item as usual and add the ProductDetails value as follows (in VB.net):
Dim ProductDetails As New ProductListingDetailsType With {
.EAN = "Does not apply"
}
I also note the requirement for an MPN and add that (it returned an error if not provided)
When I list it, I get a Failure response with the following error:
No product found for ProductListingDetails.<EAN> <Does not apply>.
If I take away the ProductDetails I get:
Required field, EAN, is missing. Please add EAN to the listing and retry, so clearly, I do need to provide this information.
I get exactly the same problem trying to revise a listing.
I have tried adding the EAN in the ItemSpecifics object instead of ProductDetails, but that returns the "EAN Missing" error, and have tried alternating between including one, or the other, or both.
So my questions are:
1: Can someone please explain to me what I am doing wrong and how I go about rectifying it, because at the moment I cannot list, or revise items on eBay at all!
2: Since most of my suppliers provide a UPC, not an EAN, am I to take it literally that the idetifier to be provided MUST be an EAN? Or can I provide the UPC field instead?
Hope this saves someone some time on the addItem and reviseItem call (it took me a while to work out)
I managed to make it work using
<ProductListingDetails>
<EAN>Does not apply</EAN>
</ProductListingDetails>
You can add following into your XML
<VariationProductListingDetails>
<EAN>$EAN</EAN>
</VariationProductListingDetails>

Getting product's tags in Prestashop

I'm new to Prestashop and I'm really struggling with it. The lack of a good documentation is a really disadvantage ans sometimes I fell like trying Magento or something like that.
Anyway, I'm trying to make a product page display a info ONLY if that product is tagged with a certain tag. I've searched for about 3 hours all over internet but couldn't find anything that solved this issue.
How can I do it? Could any of you guys please gimme a direction?
BTW, I'm using 1.5
Thanks
if you use prestashop 1.5 you need
//this is your prooduct id that you get it from your url
$id_product=Tools::getValue('id_product');
//the you use it to return all of your tags of this product with this id product
//but this return two array for example: array(array(tags))
$productTags =Tag::getProductTags($id_product);
//add this code return array(tags) ;
$productTags=$productTags[intval(Context::getContext()->cookie->id_lang)];
you can look inside the Product class. For example: Tag::getProductTags($id_product) function
Regards

What are the Aweber API Variables $account_id and $list_id?

You can check here:
https://labs.aweber.com/docs/code_samples/subs/create
The script to add a new subscriber to the list via api requires those two pieces info...only I cannot figure out for the life of me what those two variables are!! I've beaten through every little aspect of my Aweber Subscriber Account, AND my Aweber Labs account...and I can't find any reference to either of those variables anywhere. I've submitted some tickets to them, and haven't gotten any response yet.
Does anyone have any ideas here? I've tried my account names, my list names, to no avail!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, I've got it! You can get the values of both of these variables by dumping some other variables in the aweber api after making certain api calls.
get the account id first:
$account = $aweber->getAccount($accessKey, $accessSecret);
then vardump or print_r $account.
next we get the list id:
$account = $aweber->getAccount($accessKey, $accessSecret);
$list_url = 'https://api.aweber.com/1.0/accounts/<id>/lists';
$lists = $account->loadFromUrl($list_url);
then vardump or print_r $lists.
And you are all set! I'm so happy I figured this out, it freakin took long enough. Hopefully this saves some one a bit of time.
I too have agonized over finding the $list_ID, so went to deactivate the list, and create a new one, and "discovered" that if you hover over the Deactivate button, you get a url you can copy, and this gives both %account and %list Ids
https://www.aweber.com/users/lists/deactivate/$accountID/$lisID
like this....
https://www.aweber.com/users/lists/deactivate/123456/123456
Hopefully this will help make someone as it is a super easy solution
The proper answer is Anne Allen's one, but...
Check the return of the /accounts endpoint. It should return the same account id as you detected in the link, but I had cases they were different (strange, isn't it?). Use the account id returned by the /accounts endpoint and other endpoints to retrieve lists, subscribers, etc. will start to work. It's like if some accounts have two ids, one partially works and the other fully works.
Let me tell you how to get $list_id value... login into your AWeber account and then create a new list copy only integer value from list's name.
At first, login.
1) click Reports>Settings. Your account ID will be displayed in the box,example: ?id=XXXXX
2) click List Options>List Settings. There you will see the list ID under the name.
p.s. To add subscriber, you can use this - Automatically add into aweber list