How do you have separate Ad Units of the same size in Google Ad Manager running different ads? - google-ad-manager

I justed created a second Ad Unit in Google Ad Manager, of the same size as a first one. They have separate Placements.
However the same ad banners are circulating in that second Ad Unit, and I don't want them to. I want to keep separate ads running so advertisers can choose which one to use. How do I do that? I assumed having 2 Placements would already keep them separate, but it doesn't.
Any help would be appreciated.

Let's suppose you have the following setup :
Site Placement 1 allows 300x250 creative ad size
Site Placement 2 allows 300x250 creative ad size
Line Item 1 is delivering creative 1 which size is 300x250
Line Item 2 is delivering create 2 which size is also 300x250
To make sure your Line Item 1 targets only the Placement 1 and Line Item 2 targets only the Placement 2, there are different options :
add a different key-value on each placement and target it with your Line Items (see details here)
Placement 1 key "position" = "atf", and your Line Item 1 targets position=atf
Placement 2 key "position" = "btf", and your Line Item 2 target position=btf
you can also declare incremental sizes (see details here)
Placement 1 has 300x250 and 300x251 defined sizes and Line Item 2 targets 300x251 ad unit size
Placement 2 has 300x250 and 300x252 defined sizes and Line Item 2 targets 300x252 ad unit size
Once your inventory is more detailed, you will be able to target Line Items more accurately.

Related

Regex to reduce comma separated category ids to top level id

Very new to regex so question one would be is this possible?
I have products that can be in multiple categories/ subcategories, but for reporting, I just want to attribute them once per top category.
Original data:
1010,1012,1012610,1014243,10147048956,2010,201150205,2011506,2015470
Desired Result:
1010,1012,1014,2010,2011,2015
Details
1010 is unchanged
1012,1012610 reduce to 1 instance of 1012
1014243,10147048956 reduce to 1 instance of 1014
2010 is unchanged
201150205,2011506 reduce to 1 instance of 2011
2015470 is reduced to 2015
My current pattern (?|(10..)|(20..)) works well with exception to the following bold sections:
1010,1012,1012610,1014243,10147048956,2010,201150205,2011506,2015470
As for reducing, I am at a loss for where to start.
Thank you in advance for any assistance or direction.
\b(\w{4})
1010,1012,1012610,1014243,10147048956,2010,201150205,2011506,2015470
after applying regex "\b(\w{4})" can you collect values in Set it will make those element unique.

opencart product options within options

I am interested in creating different product options within options in Opencart. For example, I am selling art prints in various sizes and would like to add an additional option of framing, however the price of the frame must change according to the print size. So if a customer chooses a print of 11 in x 18 in, the framing price would display as less than if they opted for an 18 in x 24in. How can I do this in Opencart so the framing price will automatically adjust depending on print size?
I don't want to just say "Google it" but what you are looking for is an extension that implements "Dependent Options" of which there are several.
There are many in the extension store but a Google Search works better than the built-in search, so try these:
https://www.google.com/search?q=opencart+dependent+options
As always look for extensions from reputable OpenCart developers with loads of downloads, 5 star votes and positive comments.
Here is an example:
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=13882
838 sales. 5 stars and "MarketInSG" are well known and good developers.
Go to products->edit(or) add product->option tab. Here you can add the sizes of the product. once you add one size you automatically get the price tab. You can decrease or increase the price of your product for that specific size there.

How to map a data list generated from some user input to another array or list

This problem is a precursor as well as the design problem of a program I'm working upon.
We have 3 types of cards - Red (R), Green (G) and Blue (B). And they have to be placed on trays where there are multiple slots where each slot can hold exactly one card (i.e, number of cards in a filled tray at any given time = number of slots in the tray). The player/user is given a choice of choosing from the following options:
3-slot tray, where any card type (R/G/B) can occupy any slot. for example, RRG, RGB, BRR etc.
4-slot tray, where the first slot can be occupied by only one of the card types G or B and the remaining 3 can be occupied by any of the the card types. for example, BRRG, GRGB, BBRR etc.
5-slot tray, where the first slot can be occupied by only one of the card types G or B and the remaining 4 can be occupied by any of the the card types. for example, GRRBG, GRRGB, GBRRG etc.
Now, with the program, I would like to:
validate the condition(s) for 4-slot tray and 5-slot tray
generate an array (a list in python) to store the permutation entered by the player/user. In all, the 3-slot tray has 27 (3*3*3), the 4-slot tray has 54 (2*3*3*3) and the 5-slot tray has 162 (2*3*3*3*3) possible permutations and combinations.
map each of these unique permutation to another array of numbers (let us call it the number list). For example, I want to map the permutation BGRG to [1,1,2,3] (which is based on the logic i[n]=1 for n=0,1 and i[n]=n for n>1); RGG to [1,1,2] and so on.
The requirement, put concisely, is:
accept the user input
validate the input according to the conditions
generate the array number list
I can always create a hard-coded multi-dimensional array/list, but I want to write a function which is flexible to any change in the logic (as mentioned in the last point above) and generate the lis. Is there an optimized, pythonic (I'm aware that python is smart with data structures and strings and can do things neatly with fewer lines of code) way to do this? Isn't a 3D list the best way to achieve this?

Different types of Shards in Elastic Search

In domain of AWS ElasticService, different types of shards and their count is mentioned as follow:-
What do different shards mean here? I wanted to create a index of my own in new Domain and their I wanted to give number of shards? I am thinking to use this API?
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
What is the number of shards in API request object correspond to in picture?
Also, as I came to know we cannot increase number of shards later, so I wanted to ask is there any disadvantage if we give large number of shards. Eg. 40 shards for 20 nodes.
My guess:
You have 1 index with the default of 5 shards and 1 replica.
You have a .kibana index (with the Kibana configurations) with the default of 1 shard and 1 replica.
Replicas will only be allocation on different instances since it doesn't add any value in having multiple copies on the same node. If you only have 1 node, your replicas will not be allocated — those are your 6 unassigned shards.
Initializing would be when you create new shards; relocating when existing ones are currently being moved around.
If you create another index, your shards will be created according to your definition (or the default of 5 shards and 1 replica).
Every shard has a specific overhead in terms of memory and file handles. Also the search results of each shard need to be combined. So having dozens of shards per node is fine, but avoid having hundreds or even thousands. And remember: Every index will add 10 shards by default (5 primary, 5 replica), so the number of indices will make your number of shards grow over time.

Django sitemap and multiple-level indexes

finally our project is going live, and we're just missing the sitemap. Since i have to stay under the 50k links per file limit, i was thinking how to split my sitemaps in multiple levels.
Basic common structure between our 3 main sections is the LOCATION.
Each location is based on 3 levels, all of which can generate the same url patterns. I'll explain better with some pseudocode.
Location levels:
- area
- area -> district
- area -> district -> city
core 1 has 4 additional parameters
core 2 has 5 additional parameters
core 3 has 3 additional parameters
for core 1 (example) we can have:
- /area/param1/param2/param3/param4/
- /area/district/param1/param2/param3/param4/
And so on. So i was thinking in my sitemap.xml index file to explicitly address all sitemap-.xml, where section is the location levels. Sometihing like:
sitemap-us.xml
sitemap-us-alabama.xml
sitemap-us-alabama-whatever.xml
sitemap-us-alabama-whatever-reallyidontknowcitieshere.xml
And in every one of them i'll call the Sitemap method, which should check the location params and generate urls. What do you think? Is this solution correct? Any other suggestions? Best think would be me writing everything in a single sitemap method and django handling the 50k limit by itself (which isn't possible atm, i guess...)
New to Django 1.3
https://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/#creating-a-sitemap-index